Get Started

Theme switcher

Error Codes

The Error Codes widget in Theneo's web editor is a specialized tool for documenting the different types of errors that can occur while using an API. This widget helps to organize and present error information clearly, so developers and users can quickly understand and troubleshoot issues when they arise. Here's how you can effectively use this widget:

Utilizing the Error Codes Widget

  1. Insert the Widget: Go to the desired section in your document, start a new line, type /error codes, and select the Error Codes widget from the dropdown.
  2. Add Error Details: For each error, click on the Add button to create a new entry. Fill in the details such as:
    • The type of error (e.g., authentication_error, rate_limit_error, etc.)
    • A concise yet comprehensive description that explains when this error might be encountered.
  3. Reorder Errors: If you want to prioritize certain errors or arrange them in a particular order, use the up and down arrows to move them within the list.
  4. Edit or Delete Errors: Should you need to update an error's details or remove it from your documentation, click on the edit icon to modify the information or the trash can icon to delete the entry.
  5. Clarity and Actionability: Ensure that each error type has a clear name and description. Where applicable, provide actionable steps users can take to resolve the error.

Remember, the Error Codes widget is designed to help users understand specific errors related to your API's functionality, separate from the general HTTP status codes which are managed with the Status Codes widget. Using this widget enhances the usability of your API documentation by making error handling clearer and more accessible.

Was this section helpful?

What made this section unhelpful for you?

Error Codes

api_connection_error

Failure to connect to API.

api_error

API errors cover any other type of problem (e.g., a temporary problem with servers), and are extremely uncommon.

authentication_error

Failure to properly authenticate yourself in the request.

card_error

Card errors are the most common type of error you should expect to handle. They result when the user enters a card that can't be charged for some reason.

idempotency_error

Idempotency errors occur when an Idempotency-Key is re-used on a request that does not match the first request's API endpoint and parameters.

invalid_request_error

Invalid request errors arise when your request has invalid parameters.

rate_limit_error

Too many requests hit the API too quickly.

validation_error

Errors triggered by our client-side libraries when failing to validate fields (e.g., when a card number or expiration date is invalid or incomplete).

Was this section helpful?

What made this section unhelpful for you?