-
Notifications
You must be signed in to change notification settings - Fork 63
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
FallbackHandler's ExecutionContext should provide Exception getter #224
Comments
Can you explain the use case? |
Understand the possible use cases here (intelligent fallback according exception type). But wouldn't be too overkill ? |
We kind of want to notify our callers that a fault occurred, by throwing an exception from the fallback method that the caller can catch for fault details. In order to notify callers of exceptional events, we need our fallback to know about these exceptional events. We also had ideas about fallbacks that didn't notify their callers but that handled different errors more intelligently. Of course, this could be handled in another way by methods-under-fault doing work before throwing exceptions that trigger MicroProfile Fault Tolerance, but that's actually overkill also (burdening the user-programmer with disparate error-handling logic rather than unifying the error handling logic into the fallback). We are finding other approaches since both of these ideas are infeasible right now. |
After further discussion in today's hangout, we think it is useful to add a getter in the ExecutionContext interface. |
Great! Thanks! This will be helpful in the future! FWIW, for our main situation, we moved our operation that needs Fault Tolerance into an ObserveAsync listener, and we assume the process has failed until it succeeds (that is, we write out "not succeeded" before |
Signed-off-by: Emily Jiang <emijiang@uk.ibm.com>
#224 support the exception retrival
FallbackHandler
'sExecutionContext
should provide access to the exception that was caught, for example, here: https://github.com/eclipse/microprofile-fault-tolerance/blob/master/api/src/main/java/org/eclipse/microprofile/faulttolerance/Retry.java#L103The text was updated successfully, but these errors were encountered: