views:

34

answers:

1

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

A: 

Hey,

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.

Brian
as it turns out, I'm only seeing the error when I go to debug mode and use the casini (sp) web server. If I 'view in browser' I do not see the error. So I'm thinking it must be a debug setting in VS? Is there anyway to cut those down so it allows the desired output while debugging?
Kyle