Closed onurguler1 closed 1 year ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This is because the order isn't right. Exception behaviors should be the outermost ones.
Also it doesn't look like you're using the AddMediatR
method, that confuses things here. This looks like a container issue here.
Hi, in my sceneraio I have 1 exceptionhandler, 2 pipeline behaviour validation and logging. I registered them by order that I want as below: services.AddTransient(typeof(IRequestExceptionHandler<,,>), typeof(ExceptionHandlingBehaviour<,,>)); services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviour<,>)); services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehaviour<,>));
When a validationException thrown by validationbehaviour, exceptionhandlingbehaviour can not handle.