- Initial sync failures - surfaced as exceptions. The application context refuses to start with an empty cache.
- Background sync / SSE failures - never thrown. They are logged via
INexusLogger.Error(...), and the existing cache continues to be served.
Exception hierarchy
All SDK exceptions extendNexusException. A single catch clause covers everything:
When each is thrown
What is NOT thrown
- 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 -
GetConfigreturns(null, false);GetFlagreturns thedefaultValue.
The asymmetry between secrets (throw) and configs/flags (sentinel) is deliberate: a missing secret usually means “you’re misconfigured, fail fast”, while a missing flag usually means “use the safe default and continue”.
Failure scenarios
Wrong API key
Reading a secret with a public key
Reading a secret that doesn’t exist
SSE-specific behaviour
SSE failures never propagate to your code. The SDK logs them atError level and keeps the cache going via TTL polling.
client.IsStreamConnected - it flips to false when the stream falls back.