Closed zwbdzb closed 3 years ago
This is by design, you can customize it according to your needs.
The design is unreasonable, The Offical doc says the abp capture the all exception,
but can not capture the most common exception。
The Abp request must meet the any of the three requirements。
Like I said you can customize it according to your needs.
exception handler defects
The default abp scaffolding. use the Built-in exception handler , and default do not send detail info to clients。
We can enabled the
SendExceptionsDetailsToClients = true
to send the detail info to client,but the abp [ exception handler] have the following defects
Do not
Automatically handles all exceptions
, need to meet the any of the following conditionswhen the controller action output is not
object result
, the abp can not capture the action exception! I don't know why there are such restrictions , I think this is a bug!The output info have no request
TraceIdentitier
, any of the following conditionsThe output info
message
details
field is tediously long , Not suitable for frontend tool tipI think the above requirement is the common exception handler & display mode.
AbpExceptionFilter Source code
I have see the [AbpExceptionFilter] source code , The source code confirm the defects . source code
Improved solution
We can replace the default [AbpExceptionFilter], and resolve the bug. step1:
ShouldHandleException
methodstrp2
replace the default [AbpExceptionFilter] to the new ExceptionFilter:
I don't know why abp use the exception strategy, I think the above solution is more useful in practice!