Class UnhandledExceptionHandler
- Namespace
- ReactiveUI.Extensions.Async
- Assembly
- ReactiveUI.Extensions.dll
Provides a mechanism for registering a global handler to process unhandled exceptions that occur during application execution.
public static class UnhandledExceptionHandler
- Inheritance
-
UnhandledExceptionHandler
Remarks
Use this class to specify a custom action to be invoked when an unhandled exception is encountered. By default, unhandled exceptions are written to the console. Registering a handler allows applications to perform custom logging, cleanup, or user notification in response to unexpected errors. This class does not handle exceptions of type OperationCanceledException.
Methods
Register(Action<Exception>)
Registers a handler to be invoked when an unhandled exception occurs.
public static void Register(Action<Exception> unhandledExceptionHandler)
Parameters
unhandledExceptionHandlerAction<Exception>An action to execute when an unhandled exception is encountered. The exception instance is passed as a parameter to the handler. Cannot be null.
Remarks
Registering a new handler replaces any previously registered handler. The handler will be called for each unhandled exception that occurs after registration.