Skip to main content

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

QueryBuilderExceptionHandler Class

Enables you to handle server-side errors in the Web Query Builder.

Namespace: DevExpress.XtraReports.Web.QueryBuilder.Services

Assembly: DevExpress.XtraReports.v24.2.Web.dll

NuGet Package: DevExpress.Web.Reporting.Common

#Declaration

public class QueryBuilderExceptionHandler :
    ExceptionHandler,
    IQueryBuilderExceptionHandler,
    IExceptionHandler

#Remarks

The QueryBuilderExceptionHandler class has the following methods inherited from the base class:

The code snippet below demonstrates how to create a descendant from this class and override the GetUnknownExceptionMessage method to return an actual exception message.

using System;
using DevExpress.XtraReports.Web.QueryBuilder.Services;

public class CustomQueryBuilderExceptionHandler : QueryBuilderExceptionHandler {
    public override string GetUnknownExceptionMessage(Exception ex) {
        return ex.Message;
    }
}

To register the implemented exception handler, use the static DefaultQueryBuilderContainer.Register method at the application’s startup as shown below:

void Application_Start(object sender, EventArgs e) {
    // ...
    DevExpress.XtraReports.Web.QueryBuilder.DefaultQueryBuilderContainer.
      Register<IQueryBuilderExceptionHandler, CustomQueryBuilderExceptionHandler>();
}

#Inheritance

Object
ExceptionHandler
QueryBuilderExceptionHandler
See Also