0

Is there an event to catch all unhandled exceptions in Blazor Server?

AppDomain.CurrentDomain.UnhandledException isn't working because all exceptions are technically "handled" by SignalR closing the circuit. Is there an alternative event or other way to catch those exceptions anyway?

  • I assume you're asking the question because something you're doing is crashing your application. WASM/Server. Any ideas where the exception originates? – MrC aka Shaun Curtis Jul 20 '23 at 18:37
  • i don't have any exceptions like that right now. i just wanna make it easy for debugging and log unknown errors. also just for the sake of knowing how, but i guess the lack of responses is a no to my question. – cattle81194 Jul 21 '23 at 06:37
  • I don't know a way. – MrC aka Shaun Curtis Jul 21 '23 at 07:51
  • even ErrorBoundary which was made for exactly that doesn't catch errors from non-lifecycle evnet handlers which is most of any blazor app... – cattle81194 Jul 21 '23 at 08:22
  • at least not the default ones. (like how radzen uses EventCallbacks) this, i think, is my main issue – cattle81194 Jul 21 '23 at 08:50
  • In general exceptions shouldn't bubble all the way to the top. However, I believe there are contexts where exceptions in Task based methods that are set adrift or have a null return will bubble all the way up to the top. – MrC aka Shaun Curtis Jul 21 '23 at 11:04

0 Answers0