This page describes the most common types of errors (exceptions) that may occur when issuing API requests.

A server may respond to a REST API request with an HTTP response message informing about the failure of the API call. For example, if you send a simple request such as:

the sever responds with the following message in the body of the response:

	"error": {
		"code": "pathNotFound",
		"message": "/magnolia-travels/A-Taste-of-Asia"

The message informs the receiver about an exception that occurred while processing the request: the requested resource path was not found on the server.

Exception types

The tables below describe several common types of exceptions, their HTTP status codes and error codes. For exceptions not mentioned below, the status code is 500 and the error code is unknown.

JAX-RS exceptions

ExceptionHTTP Status CodeError codeDescription
BadRequestException400badRequestBad request.
NotAllowedException405methodNotAllowedThe request method is not supported.
NotAcceptableException406notAcceptableThe requested media type is not supported.
NotFoundException404notFoundThe resource was not found.
ReaderException400readerErrorA JAX-RS exception.
WriterException500writerErrorA JAX-RS exception.

Repository exceptions

ExceptionHTTP Status CodeError codeDescription
AccessDeniedException403accessDeniedAccess is denied.
NoSuchNodeTypeException500noSuchNodeTypeThe requested node type was not found.
NoSuchWorkspaceException500noSuchWorkspaceThe requested workspace is not configured.
ValueFormatException400invalidValueFormatThe value format is invalid.
InvalidQueryException400invalidQueryThe query is invalid.
PathNotFoundException404pathNotFoundThe requested resource path was not found.

Exception response format

The format of an exception response to be returned is determined as follows:

  • The response is displayed in the media type requested (see IANA's Media Types).
  • If the requested media type is not supported, JSON is returned as fallback.
  • If no resource method is matched, JSON is returned as fallback.

    The nodes and properties endpoints no longer always return exceptions in plain text.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels