After deploy the asp.net web api application, I found that when a error (exception) occurs, the return message would only be
1 | { |
But when in local debug, the message would be more detail:
1 | { |
Theoretically, you should not show those detail information to your final user, no matter for detail code security, or user experience.
But when debugging our cloud service after deploying, we may need to figure out what happened in backend.
In fact, ASP.NET web api has a separate configuration for how the error detail is shown in different environments.
In your HttpConfiguration
, there is a property called IncludeErrorDetailPolicy
. Let’s check its possible value.
1 | // Summary: |
Its comments has already show the detail, so for my case:
1 | public class Startup |
Done~~