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
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()returnscode,message,retryable,upstreamandissues. - 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: truewith{ "error": { "code", "message", "retryable" } }as structured content. Invalid arguments return anInput validation errorbefore 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
If every record in a response fails validation, the response is rejected with
UPSTREAM_SCHEMA_MISMATCH rather than returned empty.