rebus-org / Rebus

:bus: Simple and lean service bus implementation for .NET
https://mookid.dk/category/rebus
Other
2.26k stars 355 forks source link

Handle failed message with multiple handle for same message #867

Closed tresoldigiorgio closed 4 years ago

tresoldigiorgio commented 4 years ago

I've 2 classes, every class handle the same specific message and the IFailed of the message. If one handler work fine and one throw an exception both IFailed handle method are called. It's correct? I need to know the specific class and method that throw an error. It is possible?

mookid8000 commented 4 years ago

It's correct?

Sounds like that would work, yes. 🙂

I need to know the specific class and method that throw an error. It is possible?

The IFailed<TMessage> has an IEnumerable<Exception> with all of the caught exceptions, so you have as much information as Rebus can give you about what went wrong.