Error codes
The decision.error codes: why Zarex could not decide, and what to do.
The SDK never throws in your application. When Zarex cannot decide, the request goes through, the decision is marked degraded, and decision.error.code gives the reason. The same code appears in your logs. On a critical route (failMode: "closed"), the request is denied instead of going through.
onDegraded: (req, decision) => {
console.warn("Zarex could not decide:", decision.error?.code);
},The codes
| Code | Cause | What to do |
|---|---|---|
unauthorized | API key missing, miscopied or revoked. | Check ZAREX_KEY and that the key is active in the dashboard. |
quota_exceeded | Your account's technical ceiling is reached (all decisions of the month, 10 times your plan on Free, 20 times on paid plans). Exceeding your plan alone does not produce this code: protection continues. | Requests go through without inspection until the next month. Write to us. See Account and quota. |
ip_unresolved | The visitor's IP address cannot be found. | Set ipSource to match your hosting. See The visitor's IP address. |
timeout | Zarex did not answer in time. | Occasional: nothing to do. Frequent: see Troubleshooting. |
network | Connection to Zarex impossible or cut. | Check that your server can reach the Internet over HTTPS. |
circuit_open | Several failures in a row: the SDK lets traffic through without waiting, during a short pause. | Nothing to do: it retries on its own. If the message persists, see network. |
forbidden | The request to Zarex was rejected. | Check the key and the project. |
invalid_request | A rule was not accepted. | Check your rules' configuration, and update the SDK. |
server_error | Temporary error on Zarex's side. | Nothing to do: the request went through. |
bad_response | Unreadable response. | Nothing to do: the request went through. Update the SDK if it keeps happening. |
engine_error | Zarex could not evaluate the rules. | Nothing to do: the request went through. |
internal_error | Unexpected error in the SDK. | Update the SDK; if it persists, write to us. |
At startup
Some configuration errors are detected at startup of your application, rather than silently on each request: ipSource missing outside Vercel, Fly.io and Cloudflare Workers, an invalid rule (for example a negative max), more than 10 rules, a cookie filter without inspectCookies… The message tells you the fix to make.