-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publisher: Exception for artist error #861
Conversation
I've said this before - but I don't understand why this needs a new unique raised error and don't understand why this case is so special. I feel like we should only differentiate between:
As soon as we do know what happened we should strive to provide the best possible information to the user to clarify what the next steps are. That is what Can someone, in layman terms, explain why this is so unique that it needs a unique report page or error? The example screenshot provided to me is exactly one that I'd love to still be able to see with the plug-in's logs (like Publish Validation Report) and with support for actions of the plug-in. I suspect this PR only really solves the "unclear error" for Collectors, Extractors and Integrators, solely because those have been unable to generate a 'nice report' since Why couldn't a generic
So why wouldn't we use |
Just to be clear, I pointed that the exception name should be changed (and It is special because it does support title, description and detail. And I agree that As I'm thinking about it, right now the issue with |
I see - how about we add I'm just thinking of how we can simplify/have less instead of all the unique entries. Preferably the actual report page for these errors look 1:1 the same, unless there's a big reason that it requires a very unique view to data. But admittedly - this report page shown in the screenshots I feel still lacks the 'logs' of the plug-in that errored, which is annoying because it may hint to more better info already. Plus, as came up before with the PublishValidationErrors, there are plenty cases where in code it's much easier to have a few logs be the information to the user instead of, in the plug-in have to maintain a list of all the errors or variables and build up a single raise error at the very end. Since it just complicates the logic to write that.
Sure, but both could now inherit from |
If it would be argument only for validation order, then I would 100% make it different exception, even if does not have anything new implemented. Argument would cause confusion for any other order error.
As artist, you probably should not need/see those logs.
Isn't that about having reasonable message, instead of showing logs?
Isn't that what validation report does? Isn't the BTW I can't change |
It's the exact same thing with the other plug-ins. Debug logs are not artist facing, the rest are. Should be the same reasoning here?
It may be - but building up a complex "message" can be cumbersome. It gets us into this type of "building a report" logic like here which may as well have just been
We can mark it deprecated with a long retention though? If that's the better approach in this case? |
Both examples are validators. I agree that validation report should show logs, because they are meant for artists, and I think we already do that. BUT I believe that if |
I get your point, I'm just not convinced we absolutely need this distinction because the message itself will still end up thrown into the artist's face. As such, each is - in a way - artist facing. Anyway, did you make the necessary changes/refactors as you'd have liked based on our conversation? If so, then I'll give it a test run. |
TL;DR: What we try to achieve here is a nice enough message to present to Artists if the publish had to be stopped / has failed. An exception is meant to escalate unhandled event to higher levels so they can chose how to handle it. Those two things have very different goals which should not overlap. The plugins should log what they do and what they could not do, and let the system decide what's next by raising an Exception. The information carried in the Exception are for that system to decide what to do. Worst case scenario is showing it. Now, here, we're using exception as log, which escalates part the log (but not all) and creates a second path in the logging flow mixed with handling flow. Let's imagine we want to also have an nice enough message to present to Artists when the publish succeeded. Or we introduce other states than SUCCEED/FAILED like "Will retry in 5mn". That being said, we inherited this from previous implementations which evolved into using exception for reporting and managing only 2 possible states for the process. So I'm not sure there's much gain in changing the whole lot for the beauty of it. At least as of today... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a test from my side.
I wish if it were my fault 😅.
Anyways, could we convert the description into a dropdown menu?
The following image were generated by converting this runtime error to PublishError
.
raise PublishError(
title="Render failed or interrupted",
message=f"An Error occured while rendering {ropnode.path()}",
description="More Info: {}".format(exc)
)
Added logs view. |
So, this really trips up my brain. Is there a big reason why this log versus description is inverted compared to the publish validation report? Do we really need it to differ in design and layout? Can't this look very similar to the validation report (logs left, description right, actions top left) just so that everything stays familiar. Also, the buttons on the bottom with "Copy to clipboard" and "Save to disk" do raise questions. Copy what to clipboard? The text above it? The logs? The full report JSON? Same goes for the "Save to disk" - save what? I know that these are the JSON reports (they are, right?) but I can imagine newcomers might not click those to share details. I start feeling like this may be something that @mkolar just squashes in instant with a very different opinion or direction - so just tagging him to see what he says. Reference imagesJust for context some reference images of how the publisher UI behaves without this PR Publish Validation Report:Publish Success Report:KnownPublishError before this PRExpanding the bottom bar shows the raised message: |
Oh boy. Thank you @BigRoy for a ping. I agree that if we're doing this, let's at least be consistent. It should really look the same as validation error, just with a different colour. No need to make a new style of message. |
It's not new style, I've reused what we already had there (nothing new added, no new style defined). Having it same as validation error is actually much more work, and without option to have the copy/save buttons there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, will look into it. |
Should be fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog Description
Proposal of longly discussed issue to be able to show custom error message for artist instead of "This is not your fault", during publishing, by adding new exception
PublishError
.Additional info
Added new exception
PublishError
. Exception has the same attributes as validation error, but can be raised at any order and always stops publishing. The error is showed in "previously" validation error report. The report also shows validation errors if is raised during validation.Screenshot
(This is example message from traypublisher).
Testing notes:
PublishError
with custom title to trigger error.detail
to show more information, e.g. traceback.