Skip to main content
All SDK exceptions extend NexusException, which extends RuntimeException. You can catch the base class to handle all SDK errors in one place, or catch specific subclasses for fine-grained control.

Exception reference

One mapping, every endpoint

Since v0.11.0 a single status-to-exception mapping is shared by /v1/sync, /v1/flags/evaluate-ab and the three secret-write endpoints, so the same server response produces the same exception type whichever call made it:

Catching exceptions at client creation

Catching secret access errors

Catching A/B errors

Catching all SDK errors

WIF-specific errors

Catching write API errors

Quarantine

When the SDK receives a quarantine response (HTTP 429 with a JSON body containing "error": "quarantined"), it throws NexusQuarantinedException from sync() and also calls observer.onQuarantined(reason, expiresAt). For the SSE stream, the quarantine is handled automatically - the stream waits until expiresAt and reconnects without consuming its failure budget. The deadline is clamped to at most 24 hours from now, and a deadline in the past collapses to now, so both the exception and the observer callback carry a bound you can schedule against.