Open Closed

Exception with custom error messages #8855


User avatar
0
r.abouzid created
  • Template: microservice

  • Created ABP Studio Version: 0.9.5

  • Current ABP Studio Version: 0.9.21

  • UI Framework: angular

  • Theme: leptonx

  • Theme Style: system

  • Database Provider: ef

  • Database Management System: sqlserver

  • Mobile Framework: maui

  • Public Website: Yes

We are currently working on customizing the error messages returned by our ABP-based application in cases where exceptions occur. We have successfully implemented custom error messages for BusinessException as described in the ABP documentation. (https://abp.io/docs/latest/framework/fundamentals/exception-handling)
However, we are encountering difficulties in modifying the error messages for other types of exceptions (e.g., ArgumentException, InvalidOperationException, or generic Exception) . Our goal is to provide custom error messages to the client, with multilanguage support, instead of exposing the default exception details.
Specifically, we would like to know what is the recommended approach for intercepting and modifying exception messages before they are returned to the client in non-business exception scenarios?


1 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08