Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API. Mistakes happen, and are somewhat difficult to debug when you are working with an API.

Unfortunately, the Vault API is still in alpha and does not yet have very descriptive error messages. However, we are working on improving this, if you are interested in helping please reach out on Matrix or Github.


Status codes

Here is a list of the different categories of status codes returned by the Vault API. Use these to understand if a request was successful.

  • Name
    2xx
    Type
    Description

    A 2xx status code indicates a successful response.

  • Name
    4xx
    Type
    Description

    A 4xx status code indicates a client error — this means it's a you problem.

  • Name
    5xx
    Type
    Description

    A 5xx status code indicates a server error — you won't be seeing these.


Error data structure

More often than not, 4xx status codes will be returned with an error response. This is a JSON object with the following structure:

  • Name
    message
    Type
    Description

    Some human-readable text describing the error.

Error response

{
  "message": "No way this is happening!?",
}