Skip to main content
All docs
V24.2
.NET 8.0+
  • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ExceptionService.ShouldHandleException(Exception) Method

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

public virtual bool ShouldHandleException(
    Exception exception
)

#Parameters

Name Type Description
exception Exception

A Exception object.

#Returns

Type Description
Boolean

true to use IExceptionHandlerService; false for ErrorBoundary.

#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