Skip to content

Files

Latest commit

author
DevExpressExampleBot
Sep 2, 2024
e96135a · Sep 2, 2024

History

History
66 lines (43 loc) · 4.14 KB

File metadata and controls

66 lines (43 loc) · 4.14 KB

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

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)