Graceful Error Handling (2 feature requests) #1399
ArtinSarraf
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(1) Error Origin
My current understanding of the GracefulErrorAdapter is that short circuiting exception raising nodes and their downstream nodes is tied solely to the type of exception, and not where the exception originated.
Take the following example:
In this case I'd only want errors to be handled gracefully in node B originating in node D or any upstream of D. As that's the only place that has the error handling logic. However, errors from C will cause short circuiting all the way to the root since C errors have no error handling logic downstream of them. This makes for unexpected short circuited results, which would be better handled as an "unhandled" error, raising the exception as expected.
Request: Would it be possible to add a mode to GracefulErrorAdapter that only short circuits up to a function/node that is decorated with
@accept_error_sentinels, and if such a node does not exist downstream of the erroring node it will raise the exception up?(2) Error Sentinel Type
To do more thorough error handling it would be useful to get the actual exception object as the sentinel value, this would allow you to do something like this:
I see that I can do something like this:
But I can only have 1 adapter here, so I can't have all exception types handled this way, and it would not contain the original exception information either, which could be useful for logging or parsing the exception message.
Request: Would it be possible to provide something like
GracefulErrorAdapter(exception_as_sentinel_value=True)?Beta Was this translation helpful? Give feedback.
All reactions