Faults

When an error occurs, the system returns an HTTP error response code
denoting the type of error. The system also returns additional
information about the fault in the body of the response.

The error code is returned in the body of the response for convenience.
The message section returns a human-readable message. The details
section is optional and might contain useful information for tracking
down an error. For example, a stack trace might be provided.

The following is a list of possible fault types along with their
associated error codes.

Fault elementAssociated error codeExpected in most requests?
internalServerError500Yes
badRequest400Yes
serviceUnavailable503Yes
methodNotAllowed405No
unauthorized401No
notFound404No
conflict409No
notAcceptable406No
unsupportedMediaType415Yes
movedPermanently301No

From an XML schema perspective, all API faults are extensions of the
base fault type AddressAPIFault. When working with a system that binds
XML to actual classes (such as Java Architecture for XML binding
(JAXB)), you can use AddressAPIFault as a catch-all, if you don't need
to distinguish individual fault types.