set switch to trigger custom filter in asp.net mvc for exception handling
is there something I need to "turn on" to allow my asp.net mvc application to utilize custom exception filters?
I posted in here last week with code samples to a custom filter I wrote that should catch and handle a custom exception but for some reason I keep getting an error on my throw line indicating that the exception was not handled by user code.
I had a response last week from someone who indicated they copied and pasted my code exactly and it worked fine for them. This makes me wonder if maybe I need to set something web.config or something to tell the app to use the custom filter for unhandled exceptions.
please advise, TIA开发者_开发技巧
How are you implementing? If you inherit from FilterAttribute and IExceptionFilter class/interface, you will have to ensure the exception content has the exceptionhandled flag set to true to prevent the error, I believe.
精彩评论