Handle an exception
For the list of REST API exceptions, see Exceptions.
Exceptions are returned in text/html
format if no ACCEPT header or alt clause is passed, or if the ACCEPT header is invalid. See Sample Exception in HTML
If application/xml
is requested, the exception is returned in XML format compatible with the Rest Exception Schema.
If application/json
is requested, the exception is returned in a JSON format string. The Id element refers to the exception type. The Title provides more specific information. The client 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. For example, for application/octet-stream,application/xml
, the exception is returned in XML format compatible with the Rest Exception Schema. For application/octet-stream,application/json
, the exception is returned in a JSON format string.
See Also