handling exceptions IN Action Filters
Is there a better way to handle exceptions that occur inside an Action Filter itself in ASP .NET MVC?
There're 2 ways I can think of at the moment.
- Using a try catch and setting the HTTP Status Error code and message directly when an exception occurs
- Response.Redirect to the custom error page 开发者_开发问答
You may implement IExceptionFilter to separate exception handling from the rest of the filter logic.
精彩评论