ExceptionService.ShouldHandleException(Exception) Method
In This Article
Specifies how an exception is processed. If you want to process an exception through IExceptionHandlerService
, override this method and return true
; if you want to process an exception through ErrorBoundary
- return false
.
Namespace: DevExpress.ExpressApp.Blazor.Services
Assembly: DevExpress.ExpressApp.Blazor.v24.2.dll
NuGet Package: DevExpress.ExpressApp.Blazor
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
exception | Exception | A Exception object. |
#Returns
Type | Description |
---|---|
Boolean |
|
#Remarks
Override this method to indicate how you want to process an exception. See the following code snippet for an example:
C#
using System;
using DevExpress.ExpressApp.Blazor.Services;
using Microsoft.Extensions.Logging;
using DevExpress.ExpressApp;
public class CustomExceptionHandlerService : ExceptionService {
public CustomExceptionHandlerService(ILogger<ExceptionService> logger) : base(logger) {
}
public override bool ShouldHandleException(Exception exception) {
if(exception is MyException) {
return true;
}
else {
return false;
}
}
}
See Also