expressappframework-devexpress-dot-expressapp-dot-blazor-dot-services.md
A service that allows you to handle exceptions in a custom manner.
Namespace : DevExpress.ExpressApp.Blazor.Services
Assembly : DevExpress.ExpressApp.Blazor.v25.2.dll
NuGet Package : DevExpress.ExpressApp.Blazor
public class ExceptionService :
IExceptionHandlerService,
IExceptionProviderService
Public Class ExceptionService
Implements IExceptionHandlerService,
IExceptionProviderService
Note
For more information about the default error processing mechanism in XAF ASP.NET Core Blazor applications, refer to the following topic: Error Handling in ASP.NET Core Blazor.
Override the ExceptionService.HandleException(Exception) method in the class descendant to wrap an exception in a user-friendly exception.
Override the ExceptionService.ShouldHandleException(Exception) method in the class descendant to determine how you want to process exceptions.
The following example displays a user-friendly exception message in your XAF Blazor UI application:
Add a controller:
Add a MyTestExceptionService service and override the HandleException method:
Register the MyTestExceptionService service in the MySolution.Blazor.Server\Startup.cs file:
Run the application and click the Test Action button. The user-friendly exception is displayed within a toast notification.
Object ExceptionService
See Also