Handling Errors

This guide is designed to help you understand and manage errors that may occur while interacting with the API. Remember, errors are often a result of incorrect inputs or requests. We will explore various status codes and error types that you might encounter.

To determine the success of your request, check the status code in the API response. If the response is unsuccessful, the error type and error message can guide you in identifying the issue and performing basic debugging before reaching out to support.


Status codes

Here is a list of the different errors returned by the Sigmie API.

  • 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 types

Whenever a request is unsuccessful, the API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it.

Most of the error messages are pretty helpful and actionable.

Here is a list of the two error types supported by the API — use these to understand what you have done wrong.

  • Name
    batch_action/unknown
    Type
    Description

    This error occurs when the batch action is not recognized by the system.

  • Name
    request/unauthorized
    Type
    Description

    This error occurs when the request lacks valid authentication credentials.

  • Name
    index/not_found
    Type
    Description

    This error occurs when the requested index could not be found.

  • Name
    index_update/error
    Type
    Description

    This error occurs when there is an issue updating the index.

  • Name
    route/not_found
    Type
    Description

    This error occurs when the requested route could not be found.

  • Name
    request_quota/exceeded
    Type
    Description

    This error occurs when the request quota has been exceeded.

  • Name
    rate_limit/reached
    Type
    Description

    This error occurs when the rate limit has been reached.

  • Name
    query/too_large
    Type
    Description

    This error occurs when the query size exceeds the maximum limit.

  • Name
    request/failed
    Type
    Description

    This error occurs when the request failed due to server issues.

  • Name
    index_quota/exceeded
    Type
    Description

    This error occurs when the index quota has been exceeded.

  • Name
    index/not_ready
    Type
    Description

    This error occurs when the index is not ready.

  • Name
    request/forbidden
    Type
    Description

    This error occurs when the request is forbidden due to insufficient permissions.

  • Name
    field_limit/exceeded
    Type
    Description

    This error occurs when the field limit has been exceeded.

  • Name
    document_quota/exceeded
    Type
    Description

    This error occurs when the document quota has been exceeded.

  • Name
    document/not_found
    Type
    Description

    This error occurs when the requested document could not be found.

  • Name
    document/invalid
    Type
    Description

    This error occurs when the document is invalid or malformed.

  • Name
    request/bad
    Type
    Description

    This error occurs when the request is malformed or contains invalid parameters.

  • Name
    attribute/not_filterable
    Type
    Description

    This error occurs when the attribute is not filterable.

Error response

{
  "error" : "document/not_found",
  "message"  "A document with the _id 'Ont8qIIBrbFU6hq5wjQx' couldn't be found."
}