HTTPError Exception Message not displaying when webapi is run on Server vs being run locally

I found that these needed to be turned on in the GlobalConfiguration for the webapi itself:

1: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.LocalOnly;
2: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
3: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never;

The server actually determines how much detail to display, the default is LocalOnly.

Our logging method is not considered local, I guess because it is not actually built into the API itself, but because it is in a shared dll between multiple APIs.

I found this article to be very helpful.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)