-
Notifications
You must be signed in to change notification settings - Fork 7
Common errors
Every Cryptohopper SDK surfaces errors with the same code taxonomy. Here's what each one actually means in practice and how to debug it.
code |
HTTP | Meaning | Most-common cause |
|---|---|---|---|
UNAUTHORIZED |
401 | Token invalid / missing | Token expired, never issued, or pasted wrong (try cryptohopper whoami) |
FORBIDDEN |
403 | Token valid but not permitted | OAuth app has IP allowlist that doesn't include your current IP — error includes ip_address field |
DEVICE_UNAUTHORIZED |
402 | Mobile device flow only | Public SDK users won't see this |
NOT_FOUND |
404 | Resource or endpoint gone | Wrong ID, hopper deleted, or endpoint typo |
VALIDATION_ERROR |
400 / 422 | Bad parameters | Missing required field, wrong type, value out of range |
CONFLICT |
409 | State conflict | Trying to create something that already exists, or operate on a hopper in the wrong state |
RATE_LIMITED |
429 | Too many requests | SDK auto-retries with Retry-After; only surfaces after maxRetries
|
SERVER_ERROR |
500/502/504 | Upstream blip | Retry; if persistent check status page |
SERVICE_UNAVAILABLE |
503 | Maintenance window | Try again in a few minutes |
NETWORK_ERROR |
— | Couldn't reach the server | DNS, firewall, corporate proxy blocking, TLS handshake failure |
TIMEOUT |
— | Request exceeded total deadline | Slow network or backend; tighten/relax timeout per workload |
UNKNOWN |
— | Catch-all | Should be rare; report if you see one |
cryptohopper whoami --jsonIf this returns ok, the token is valid — your code is doing something different (different env var? wrong header? trimming the token?).
If this returns UNAUTHORIZED too, the token is bad. cryptohopper login to reissue, or check the developer dashboard.
{"code": "FORBIDDEN", "ip_address": "203.0.113.42"}
Means the server saw your request from 203.0.113.42 and that IP isn't on your OAuth app's allowlist. Either add it (developer dashboard → OAuth apps → IP allowlist) or disable the allowlist for that app.
The error message contains the exact field. Common gotchas:
- Date fields want
YYYY-MM-DDstrings, not Date objects. - Boolean flags want
0/1integers, nottrue/false. -
hopper_idmust be a number/string the server recognizes — checkcryptohopper hoppers listto confirm it exists.
You're sharing the rate-limit bucket with other unattributed callers using your token. Pass appKey (your OAuth client_id) to the SDK constructor — that gets you a separate per-app bucket.
Corporate proxies often strip the access-token header (they think it looks like sensitive data). Either configure the proxy to pass it through, or use HTTPS_PROXY env var so the SDK sees the proxy and Trust-its-egress.
The backtest itself takes minutes. The poll calls (backtest.get) should be fast. If backtest.get itself times out, your network is the problem, not the backtest.
This is the AWS API Gateway rejecting your Authorization: Bearer header. Switch to access-token. See Auth-header-gotcha.
If the server adds a new error code, the SDK passes it through verbatim on code. Compare with ==, never substring-match. The KNOWN_CODES set on each SDK enumerates what the SDK currently emits — anything outside that set is forward-compatibility.
- Recipe: retry-fail-fast — which codes to retry, which to fail fast on
- Each SDK's Error-Handling wiki for language-specific patterns
Pages
Repository
SDK suite