Errors

Error structure

Each JSON response sent by our services contains an Error object, which is initialized depending on the resulting status of the operation.

  • If Status=OK , the Error object is set to null .
  • If Status=ERROR , it means that the request was executed but the expected result was not achieved. In this scenario, the Error object is made up of 3 elements, all of which are strings:
    • Code
    • Type
    • Description

The details of each field are as follows:

Code

The value is an internal code used by Khipu to group and classify the most common errors.

The subdivisions are:

Error Code
Description
A000 Authentication error. There is a problem with the JWT token (it is either expired, revoked or invalid).
E100 - E199 Logon errors reported by the target service, such as invalid credentials or blocked account.
E2xx - E299 These codes are returned if the destination service is unavailable or has problems serving the request.
E3xx - E399 No data available. The process completed successfully, but could not find the expected information. For example, requesting bank transactions for a month that is not yet available.
E4xx - E499 User errors related to bad parameter values, such as invalid dates or a non-existent currency.
E5xx - E599 This group is dedicated to errors related to automatic payment services.
E999 User-defined error message accompanied by a descriptive text. Used when the information does not fit into the above groups.
E000 Used for generic errors with no description.
D000 Missing information to complete the process. This means that the scraping service must be completed before it returns a successful result.
F000 Error during the data processing function that generates the JSON response.
T000 Timeout while scraping the target service.
I001 - I003 Infrastructure error. Used to indicate a missing internal component or invalid generated responses.
P001 - P003 Used when there are errors in the request parameters, such as an invalid URL for asynchronous calls.
L000 This code is sent to the webhook of an asynchronous call when the timeout for trying to retrieve the data is reached.

Type

This value tells you how to handle an error based on its characteristics. For example, if a response contains an error indicating that the credentials are invalid and the account will be blocked on the next bad attempt, you probably should not retry the same request. On the other hand, if a response indicates that the target service is temporarily unavailable, you can safely retry your request. It is also possible that we need to fix something in a particular service, in which case we will tell you when you can retry your request.

Error Type
Description
DO_NOT_RETRY Avoid sending the same request when it is clear that it will not work (used in cases of incomplete/bad credentials or blocked accounts).
RETRY_IMMEDIATELY You can safely retry the same request. The error was due to a read timeout or a hiccup in the destination service.
WAIT_4_HOURS_BEFORE_RETRY Please wait for the specified amount of time to elapse before submitting your request again. There's some work to be done on our end.

Description

This field explains the error in more detail to help you understand what went wrong. This can be the specific message returned by the data source, or a generic description that applies to all errors with a particular code.

Example

Here is an example of what an Error object looks like in a bad response:

Copy
Copied
{
  "OperationId": "6baf6c19-e485-463b-ae24-a821b025c8a4",
  "Status": "ERROR",
  "Data": null,
  "AdditionalInformation": null,
  "Error": {
    "Code": "E201",
    "Type": "RETRY_IMMEDIATELY",
    "Description": "The target service used for data extraction is not available."
  },
  "LifeSpan": null
}