The requested page is not available for the requested platform. You are viewing the content for Default platform.

IQueryBuilderExceptionHandler Interface

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

Namespace: DevExpress.XtraReports.Web.QueryBuilder.Services

Assembly: DevExpress.XtraReports.v19.1.Web.dll

Declaration

public interface IQueryBuilderExceptionHandler :
    IExceptionHandler
Public Interface IQueryBuilderExceptionHandler
    Inherits IExceptionHandler

Remarks

This interface is inherited from the base IExceptionHandler interface and exposes the GetExceptionMessage method that is called when any server-side error occurs.

The following code snippet demonstrates how to implement this method and return an actual exception message:

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

public class CustomExceptionHandler : IQueryBuilderExceptionHandler {
    public string GetExceptionMessage(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, CustomExceptionHandler>();
}
See Also