Errors
Every error carries a code, the same over REST and the WebSocket. Build your logic on that code: the message text may change, the code never will.
Over REST
{
"type": "https://fathomcharts.com/docs/errors#invalid-parameters",
"title": "Invalid parameters",
"status": 400,
"detail": "Invalid indicator parameters",
"code": "INVALID_PARAMETERS",
"instance": "req-1b",
"errors": [
{ "path": "/minimum", "message": "must be >= 1" }
]
}code: the error code, listed below;detail: a human-readable explanation;errors: forINVALID_PARAMETERS, the list of problems, with the location of each faulty field (path);instance: the request id, to share with support if needed.
When a history query or an export exceeds your budget, the response also gives its cost (computeUnits) and what you have left (remainingComputeUnits). 429 responses carry a Retry-After header: the number of seconds to wait.
Over the WebSocket
A refused or interrupted subscription receives an error message with its sub. Only that subscription is closed: the connection and your other subscriptions keep running.
{"sub":"bt","t":"error","code":"UNKNOWN_INDICATOR","message":"unknown indicator `big-trade`"}A message the server cannot understand (invalid JSON, unknown type…) receives an error without a sub.
With the SDK, a subscription error ends its iteration with a FathomChartsError carrying the received code.
Problems that close the whole connection (key rejected, too many connections, client too slow) do not come as error messages but as close codes.
Code reference
| Code | HTTP | Meaning | What to do |
|---|---|---|---|
INVALID_PARAMETERSInvalid parameters | 400 · 413 · 415 | Invalid request: a field is unknown, missing, of the wrong type or out of range (400), the body is over 16 KB (413), or the body is not JSON (415). | Fix the request. The errors field lists each problem and where it is. |
UNKNOWN_INDICATORUnknown indicator | 404 | This indicator does not exist. | Check the id in the catalog (GET /v1/indicators). |
UNKNOWN_INSTRUMENTUnknown instrument | 404 | This instrument is not available. | Check the symbol with GET /v1/instruments. For a contract that is not streamed in real time, set dataset. |
NOT_COVEREDRange not covered | 402 | No data for all or part of the requested range. | Narrow the range. The estimate lists the missing days (missingDays). |
WARMINGWarming up | 409 | The calculation is warming up and not ready yet. | Retry in a few moments. |
QUOTA_EXCEEDEDQuota exceeded | 429 · 409 | You hit a limit of your plan: the monthly compute budget or export volume (429), the number of subscriptions or custom configurations (WebSocket), or 10 active keys (409). | Check GET /v1/usage. Narrow the range, wait for next month (Retry-After), close a subscription or revoke a key. |
RATE_LIMITEDRate limited | 429 | Too many requests in a short time. | Wait for the number of seconds given in Retry-After. |
CAPACITYCapacity reached | 503 | The service is temporarily at capacity. | Retry with exponential backoff. |
CURSOR_EXPIREDCursor expired | 410 | The next-page cursor (next) is too old. | Run the query again from the start. |
UNAUTHORIZEDUnauthorized | 401 | The key or token is missing, invalid, expired or revoked, or the sign-in link has expired or was already used. | Check the Authorization header, or request a new token or a new link. |
FORBIDDENForbidden | 403 | You are authenticated but not allowed to access what you asked for: the key lacks a scope, the instrument or IP address is not allowed, or your plan does not cover the request. | The message says what is missing: adjust the key or add the offer you need. |
NOT_FOUNDNot found | 404 | Unknown URL, or the key does not exist. | Check the URL and the id. |
CONFLICTConflict | 409 | The action is not possible in the current state: the key was already rotated, you already own the offer, or the billing country is served by a different payment provider than the account’s. | Check the current state before trying again. |
WITHDRAWAL_WAIVER_REQUIREDWithdrawal waiver required | 400 | The checkout was started without the waiver of the right of withdrawal, or with an older version of its text. | Reload the account page, tick the box, then try again. |
SOURCE_DOWNSource down | — (WebSocket) | Data for this instrument is temporarily unavailable. | Retry later. GET /v1/instruments reports the state of each instrument. |
UPSTREAM_ERRORUpstream error | 502 | A service we depend on returned an unexpected response. | Retry with exponential backoff. |
INTERNALInternal error | 500 | Something went wrong on our side. | Retry. If it persists, contact support with the instance value of the response. |