Can I use `handleerrorattribute` with custom exception filters?

Question

Grade: Education Subject: Support
Can I use `handleerrorattribute` with custom exception filters?
Asked by:
63 Viewed 63 Answers

Answer (63)

Best Answer
(392)
Yes, `HandleErrorAttribute` and custom exception filters can work together. Exception filters can handle specific exception types, and if an exception reaches the `HandleErrorAttribute` (meaning it wasn't handled by a filter), the attribute will then take over and render the error page or response. The order of execution is important; filters are executed before the `HandleErrorAttribute`.