2

Closed

Web API - Link Web.Config custom errors and error detail policy

description

Deploying to IIS means that Web API applications have two settings for custom errors. One for the ASP.NET WebForms/MVC applications (web.config) and one for Web API. Having the ability to link the two would allow for one config-based setting to be used. See:

http://lostechies.com/jimmybogard/2012/04/18/custom-errors-and-error-detail-policy-in-asp-net-web-api/

And

https://github.com/WebApiContrib/WebAPIContrib/commit/27381146d65b3958cf267e7bb7fcd80e1b913b66
Closed Jul 26, 2012 at 5:23 PM by trdai

comments

HongmeiG wrote Apr 23, 2012 at 5:08 PM

In the web host scenario, it would be good default our settings based on the CustomError settings from ASPNET.

raghuramn wrote Apr 24, 2012 at 8:43 PM

I am worried if we can access the settings in partial trust. I will verify.

raghuramn wrote Jun 4, 2012 at 6:30 PM

Fixed with changeset - http://aspnetwebstack.codeplex.com/SourceControl/changeset/changes/f2b8ff9ad547

This change introduces a new IncludeErrorDetailPolicy (Default). If
IncludeErrorDetailPolicy is set to Default on HttpConfiguration we fall
back to the host specific behavior for showing error messages which is
1) defined by the ASP.NET CustomErrors configuration section for web
host.
2) LocalOnly for self host.