Skip to content

The example shows two approaches on how to handle errors in the ASP.NET Core Dashboard application

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-core-dashboard-handle-errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BI Dashboard for ASP.NET Core - How to handle errors

The following example demostrates two approaches on how to handle errors in the ASP.NET Core Dashboard application:

  • How to specify custom text for internal Dashboard errors
  • How to throw a custom exception during a server-side processing and display the error in the Dashboard error toast

How to specify custom text for internal Dashboard errors

Files to Review

Description

The dashboard in this project contains invalid data connection. This example shows how to override the default text in the exception that occurs when a controller tries to load data.

  1. Implement the IExceptionFilter interface to create a custom exception filter and specify a custom exception message. You can specify the displayed text depending on whether the application is in development mode.
  2. Create a custom controller that uses the custom exception filter.
  3. Specify the CustomDashboard controller when you configure endpoints.

How to throw a custom exception during a server-side processing and display the error in the Dashboard error toast

Files to Review

Description

This example shows how to throw a custom exception when a controller loads a dashboard.

  1. Implement the IExceptionFilter interface to create a custom exception filter. You can specify the displayed text depending on whether the application is in development mode.
  2. Create a custom controller that uses the custom exception filter.
  3. Specify the CustomDashboard controller when you configure endpoints.
  4. To throw an exception when the control loads a dashboard, create custom dashboard storage and override the LoadDashboard method.

Documentation

More Examples