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.
To handle REST exceptions, extract the exception Id and Title and take 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.