Skip to main content
The SDK distinguishes between two classes of failures:
  1. Initial sync failures - surfaced as exceptions from NexusClient.create() / await AsyncNexusClient.create(). The application should refuse to start with an empty cache.
  2. Background sync / SSE failures - never raised. They are logged via NexusLogger.error(...), and the existing cache continues to be served.

Error hierarchy

All SDK exceptions extend NexusError. A single except clause covers everything:
The full hierarchy:

When each is raised

What is NOT raised

  • Background syncs - silently retried on the next TTL tick. Cache served.
  • SSE transport errors - exponential backoff, 3-strike fallback to polling. No exception surfaces.
  • 304 Not Modified - treated as success; TTL reset.
  • Missing config / flag - get_config returns the default (or None); get_flag returns the default (or False).

Failure scenarios

Wrong API key

Network down at startup

Reading a secret with a public key

Reading a secret that doesn’t exist

Reading a non-existent flag or config

Returns the default - no exception:

Async-specific notes

The async client uses the same exception hierarchy. The only difference is that await AsyncNexusClient.create(...) is a coroutine, and async with is the equivalent of the sync with statement.