You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I use Wolverine as a replacement for Mediatr in an ASP.NET core webapp
I have several commands that return values, and I use InvokeAsync to call the Wolverine handlers.
If there is an unhandled exception thrown by either handler, I want to log that exception.
Here is my Wolverine setup
I tried using a middleware (commented code), I can not achieve what I want
The only way I managed to have the unhandled exception logged is via a Configure() method in the handler
public static void Configure(HandlerChain chain) => chain.LogUnhandledException<MyHandler>();and that LogUnhandledException is an extension method
However, writing that Configure() for every handler is quite verbose.
Isn't there a simpler way to configure this global exception handler ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions