Where is the ErrorDetailPolicy is handled

Topics: ASP.NET Web API
Jul 19, 2012 at 9:12 AM

Where is the ErrorDetailPolicy is handled? I looked at HttpControllerHandler, HttpControllerDispatcher, HttpServer and several other places but couldn't see where the decision is made wether the details of the exception should be sent or not.

Am I going blind or looking at the wrong places?

Jul 19, 2012 at 5:26 PM

Check out the HttpConfiguration.ShouldIncludeErrorDetail() method.

Jul 19, 2012 at 6:32 PM

The ErrorDetailPolicy is honored by the CreateErrorResponse extension method.

Daniel Roth

Jul 19, 2012 at 9:38 PM

nice, thanks guys!