Skip to content

The middleware's catch block does not get triggered when errors occur in a controller that extends a ServiceEndpoint. #7027

Discussion options

You must be logged in to vote

The ServiceEndpoint has an HandleServiceExceptionAttribute applied to it. This attribute inherits from ExceptionFilterAttribute. The filter catches exceptions in the inner scope. This means that if the controller scope has such an attribute or filter that handles the exception, the middleware or other ways of handling exceptions provided by ASP.NET may not be used. The filter takes the exception, deals with it according to the logic in the filter, and may stop it from going up to the higher levels of the application where middleware could handle it otherwise.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@VictorTomaili
Comment options

@EdwinThomas11
Comment options

@VictorTomaili
Comment options

Answer selected by EdwinThomas11
@EdwinThomas11
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants