I created a CrudAppService. When I invoke its dynamic api by using swagger, I get a generic 500
error with this description:
{
"result": null,
"targetUrl": null,
"success": false,
"error": {
"code": 0,
"message": "An internal error occurred during your request!",
"details": null,
"validationErrors": null
},
"unAuthorizedRequest": false,
"__abp": true
}
How can I get a more detailed exception to debug? Is there something I have to enable?
ABP + ASP.NET Core
If you use
CurrentUnitOfWork
, you can catch the exception also and usingUserFriendlyException
you can throw the desired exception.UserFriendlyException
is a specific type of exception so ABP directly shows exception message to the end user.Example:
Check error in Logs.txt.
From the documentation on Logging:
You can simply send the exception detail to the client by enabling one of the ABP configuration (SendAllExceptionsToClients) to true as
in ***.Web.Core Module.
Then you get the exception detail on the client. (Recommended only during development)