ES06 - Error Responses

Revisions

  • Initial version v1 (March 1, 2026).

Summary

This document outlines the format of error responses returned by the backend API.

This applies to the Rust version of the backend. At the time of writing this documentation, this error formatting has not been applied to the Go version, but occurred as a side effect of using Result types in Rust.

Error Responses

All errors returned from the backend should be accompanied with a HTTP Status Code, a Code ID, and a simple message to explain the code:

{
  "status": 500,
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Something went wrong"
}

The table below serves as the source of truth for error codes.

CodeDescription
BINDING_FAILEDRequest body is missing certain fields.
VALIDATION_FAILEDRequest body, path or query validation failed.
WRONG_PASSWORDThe password inputted was wrong.
USER_NOT_FOUNDThe requested user could not be found.
USER_NO_PASSWORDThe requested account does not use passwords to authenticate.
USER_ALREADY_EXISTSThere is already a user with the used email.
UNAUTHENTICATEDThe endpoint is protected, and the user is not authenticated.
INVALID_ORIGINOrigin header has an invalid URL.
SERVICE_UNAVAILABLEThe requested service should not be available.
UNKNOWN_TENANTThe requested tenant is not found.
FAILED_TO_SET_HEADERSThe server failed to set the correct headers.
INTERNAL_SERVER_ERRORGeneric internal server error. The server is at fault.

Back to top

© Nguyệt Ánh 2025. Licensed under CC BY-SA 4.0.

This site uses Just the Docs, a documentation theme for Jekyll.