eZ Documentation Center

This is outdated documentation made for eZ Publish Platform 5.1. It is being moved into the eZ Publish 5.x documentation, so please go there for most up-to-date documentation.

Skip to end of metadata
Go to start of metadata

Error handling in our REST API is fully based on HTTP error codes. As a web developer, you are familiar with the most common ones: 401 Unauthorized, 404 Not Found or 500 Internal Server Error. The REST API uses those, along with a few more, to provide error handling.

General error codes

As explained in the specifications, a few error codes apply to most resources (if they are applicable)

500 Internal Server Error

The server encountered an unexpected condition, usually an exception, which prevented it from fulfilling the request: database down, permissions or configuration error.

501 Not Implemented

Returned when the requested method has not yet been implemented. As of eZ Publish 5.0, most of user, group, content, location and content type have been implemented. Some of their methods, as well as other features, may return a 501.

404 Not Found

Returned when the request failed because the request object was not found. You should be familiar with this one.

405 Method Not Allowed

Returned when the requested REST API resource doesn't support the HTTP verb that was used.

406 Not Acceptable

Returned when an accept header sent with the requested isn't supported.

Error handling in your REST implementation

It is up to you, in your implementation, to handle those codes by checking if an error code (4xx or 5xx) was returned instead of an expected 2xx or 3xx.

  • No labels