Skip to content
StockSync
Docs · Errors and warnings

Reference

Errors and warnings

StockSync separates failures from gaps. A failure is a StockSyncError with a stable code. A gap that does not stop the request, such as a skipped record or an unreadable contract, is a data warning attached to the result.

Error codes

CodeMeaningRetryableCLI exit
INVALID_INPUTMalformed symbol, address, query or optionNo2
UNSUPPORTED_CHAINThe chain is neither mainnet (4663) nor testnet (46630)No2
UNSUPPORTED_CONTRACTThe address has no code, or lacks the required interfaceNo2
NOT_FOUNDA required record does not exist, such as an unlisted tickerNo3
CONFIG_INVALIDEnvironment configuration failed validationNo5
UPSTREAM_TIMEOUTAn upstream did not respond in timeYes4
UPSTREAM_UNAVAILABLENetwork failure or HTTP 5xxYes4
UPSTREAM_RATE_LIMITEDHTTP 429Yes4
UPSTREAM_HTTP_ERRORAny other unexpected HTTP statusNo4
UPSTREAM_SCHEMA_MISMATCHThe upstream responded in a shape StockSync could not validateNo4
RPC_ERRORA Robinhood Chain RPC read failedYes4

Transient failures are retried inside StockSync before an error is raised: up to three attempts with jittered backoff, honoring Retry-After. retryable: true means trying again later may succeed.

Error messages name the endpoint path, never the full URL, because provider URLs often embed API keys.

How each surface reports errors

  • SDK: methods throw StockSyncError. error.toJSON() returns code, message, retryable, upstream and issues.
  • CLI: errors go to stderr with a code: line and a hint, and the process exits with the code above. With --json, stdout receives { "ok": false, "error": { … } } instead.
  • MCP server: tools return isError: true with { "error": { "code", "message", "retryable" } } as structured content. Invalid arguments return an Input validation error before any upstream is called.

A lookup that finds nothing is not an error: getAsset returns data: null, and the MCP tools return found: false.

Data warnings

CodeMeaning
UNRECOGNIZED_ENUM_VALUEAn upstream value StockSync does not know yet; shown as unrecognized
UNDOCUMENTED_RESPONSE_SHAPEThe upstream used a shape its documentation does not describe
RECORD_SKIPPED_INVALIDOne record failed validation and was left out
PARTIAL_RESPONSEOnly part of the requested data was returned
SYMBOL_NOT_FOUNDA requested symbol has no quote
SERVED_STALE_AFTER_UPSTREAM_ERRORAn expired response was served because the upstream failed
QUOTE_UNAVAILABLEThe quote could not be loaded, so the trading halt is unknown
ONCHAIN_READ_FAILEDThe contract could not be read; registry values are shown alone
MULTIPLIER_MISMATCHThe registry and the contract report different multipliers
PENDING_MULTIPLIER_PAST_EFFECTIVE_TIMEA registry pending change has passed its effective time
ORACLE_PAUSEDThe token reports oraclePaused()
PRICE_FEED_BEYOND_HEARTBEATThe Chainlink feed has not updated within its heartbeat
SECTION_UNAVAILABLEOne section of an inspection could not be loaded
WARNINGS_TRUNCATEDMore warnings occurred than a result carries

If every record in a response fails validation, the response is rejected with UPSTREAM_SCHEMA_MISMATCH rather than returned empty.