Errors

In this guide, we will delve into what happens when something goes wrong while working with the Hypercode API. Mistakes can occur, and it's essential to understand how to interpret the error messages to troubleshoot and resolve issues.

You can identify if your request was successful by examining the status code in the API response. If a response is unsuccessful, you can analyze the error type and error message to understand what has gone wrong.

Status codes

Here is a list of the different categories of status codes returned by the Hypercode API. Use these to gauge 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 might mean an incorrect request from your side.

  • Name
    5xx
    Type
    Description

    A 5xx status code indicates a server error — something went wrong on our end.

Error types

When a request is unsuccessful, the Hypercode API will return an error response containing an error type and message. This information will help you diagnose what went wrong and how to address it.

Here is a list of common error types you might encounter:

  • Name
    api_error
    Type
    Description

    An unexpected error occurred on our end.

  • Name
    invalid_request
    Type
    Description

    The request was invalid or improperly formatted.

  • Name
    authentication_error
    Type
    Description

    An issue occurred with authentication or permissions.

Example Error Response

{
  "type": "invalid_request",
  "message": "The query parameter is missing.",
}