Developer Documentation Library > Web API > Web API application > Error handling by the Web API
 
Error handling by the Web API
Responses include an HTTP status value.
Value
Description
2xx
Success
4xx
The request from the client was invalid
5xx
The server is unable to process the request
Error statuses normally include a JSON response body, which has a “message” property. In most cases, the message says just “An error has occurred”; that is, it does not contain any server information. To control the level of detail that is in the error response, use the IncludeErrorDetailPolicy property in DPM:
The default level is “LocalOnly”; that is, only clients that are on the same computer as the Web API receive a detailed message.
For testing the Web API, set IncludeErrorDetailPolicy to “Always”.
The API log file always includes the detailed error message, even if the client is sent only a basic error message.
See
Web API application