-
ABP Framework version: v9.0.4
-
UI Type: Blazor WASM
-
Database System: EF Core (SQL Server)
-
Tiered (for MVC) or Auth Server Separated (for Angular): no
-
Exception message and full stack trace:
-
Steps to reproduce the issue:
Hi, we have a problem override AbpExceptionFilter.
We have this class override the methods
In the host module, replace the services,
for the class DefaultExceptionToErrorInfoConverter it works
in application initialization we added this code to verified if replace the class, returns SmcExceptionFilter
And in program host class also debugging and check
But when the exception is triggered, the debugging point stops in the class of AbpExceptionFilter
Any points to check why this might happen?
2 Answer(s)
-
0
Hi, instead of removing the
IAsyncExceptionFilter
registration from DI container, you can directly replace the related exception filter like this:context.Services.Configure<MvcOptions>(options => { options.Filters.ReplaceOne( f => f is ServiceFilterAttribute fa && fa.ServiceType == typeof(AbpExceptionFilter), new ServiceFilterAttribute(typeof(YourAbpExceptionFilter)) ); options.Filters.ReplaceOne( f => f is ServiceFilterAttribute fa && fa.ServiceType == typeof(AbpExceptionPageFilter), new ServiceFilterAttribute(typeof(YourAbpExceptionPageFilter)) ); });
After adding this configuration, you can delete the last two service replacement in the shared code and it should work as expected.
Regards.
-
0
It works, thanks a lot