Working with the API > How Do I... > Handle an Exception |
Exceptions are returned in the format specified in the ACCEPT header, generally application/json
. In JSON format,the Id element refers to the exception type. The Title provides more specific information. See Sample Exception in JSON.
Your application handles REST exceptions by extracting the exception Id and Title, and taking application-appropriate action.
If the ACCEPT header is a binary type, exceptions are returned in text/html
format. However, if an additional valid content type is requested, the error is returned according to the additional type.
If the ACCEPT header is invalid, exceptions are returned in text/html
format.