Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The form of the responses in case of an error, differs dependent of the thrown error.

In general the returned HTTP response codes are used as defined in https://datatracker.ietf.org/doc/html/rfc9110.

Though only the following are used:

Status CodeGeneral MeaningIn translate5
401 Unauthorized

Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. 

No user is authenticated by the request.
403 Forbidden

The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource.
Unlike 401 Unauthorized, the client's identity is known to the server.

See the additional error message in the result. This status code is returned when trying to access an API endpoint where the current user has no access rights.
This status code is also used for other business logic based access rules (not only ACL based).
Also when trying to do malicious requests the application might answer with an 403.
404 Not Found

The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist.

Either then whole API endpoint does not exist, or the concrete requested resource does not exist. For example when requesting a task: GET /editor/task/123 might return a 404 f the task was deleted.
405 Method Not Allowed

The request method is known by the server but is not supported by the target resource. For example, an API may not allow calling DELETE to remove a resource.

Not all HTTP methods are implemented in all API endpoints. So if an invalid one was used 405 is returned.
409 Conflict

This response is sent when a request conflicts with the current state of the server.

See the additional error message in the result. One prominent example: The data on the server has changed in the meantime and must be reloaded.
422 Unprocessable Entity

The request was well-formed but was unable to be followed due to semantic errors.

See the additional error message in the result. The data itself produces an error, for example when creating a user where the login is already in use.
500 Internal Server Error

The server has encountered a situation it does not know how to handle.

Multi-purpose error, see the additional error messages in the result.
502 Bad Gateway

This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.

Might be send if a underlying language resource (which are foreign services) can not be used.
503 Service Unavailable

The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. 

The installation is in maintenance.

HTTP 422 Unprocessable Entity / HTTP 409 Conflict

...