-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error handler not having access to the original exceptions #1154
Comments
…ions - DefaultRetryStep using ExceptionInfo factory to create ExceptionInfo instead of newing it up; when configuring Rebus with InMemExceptionInfoFactory [Configure.With(activator).Errors(e => e.UseInMemExceptionInfos())], an error handler will get an instance of InMemExceptionInfo in HandlePoisonMessage method, with InMemExceptionInfo storing all exceptions within AggregateException; not tested - tests will be added in a subsequent commit when this approach is approved
@mookid8000 I committed an attempt to fix this: xhafan@4be1c8e Could you please have a look and let me know if you would approve this approach. If yes, I will add unit tests, and create a pull request. If no, please suggest improvements 🙂. Thank you. |
Hi @xhafan , did you read the section about exception info on the wiki? 👉 https://github.com/rebus-org/Rebus/wiki/Automatic-retries-and-error-handling#exception-information |
Yes, I have read it. But it does not work for me as |
@mookid8000 Is my implementation of |
We have the same issue described in the previous comments. The original exception is being lost, and we cannot access it in the |
We've run into the same issue with the original exception being lost by the time it reaches a custom
My suggestion would be to update the |
I started populating
This workaround works for me, but still I would prefer the original solution where the |
I have this Rebus 7
IErrorHandler
implementation to report failed messages on Slack:It uses
Exception.InnerException
to detect the exception thrown in the message handler, and behave differently based on the exception type.In Rebus 8,
Exception
has been changed toExceptionInfo
without access toInnerException
. I refactored the code to this:Not ideal in my opinion that the
InnerException
disappeared, and it's now doing a stringology (exception.Details.Contains(nameof(UserException))
). Is there a better way in Rebus how to implement failed message reporting, and get access to the thrown inner exception message?Also reported on SO: https://stackoverflow.com/questions/77804512/rebus-7-ierrorhandler-implementation-not-compatible-with-rebus-8
The text was updated successfully, but these errors were encountered: