Beta

Error Handling

Learn on how to handle error with CakeAuth platform

CakeAuth related error messages are consistent. It's the type of CakeAuthErrorResponse object.

This object contains code, url, and message property. These properties you can use to provide more concise and clear error message for you (as the developer) and for your users.

Example response object

{
  "status": 401,
  "metadata": {
    "timestamp": 1739259797695,
    "request_id": "req_8a24d330a12391967dda48906d2e22d8",
    "page": null,
    "page_size": null,
    "total": null
  },
  "error": {
    "url": "https://docs.cakeauth.com/docs/references/errors#invalid_tenant_credentials",
    "code": "invalid_tenant_credentials",
    "message": "Provided credentials are invalid."
  },
  "data": null
}

Good to Know

To see the list of error codes, visit the error code references

Hyrum's Law

Whenever you need to do some error matching, please depends only on the code values. Other values including message and url might change overtime.

Some error codes might get reused (eg. invalid_payload). If you encounter an error codes that you think needs a dedicated error codes, please let us know.

Last updated on

On this page