.md

Errors

Every error class the SDK throws, rooted at SecondLayerError. Catch the root to handle all of them, or a subclass to handle one.

SecondLayerError root of the family
├─ ApiError Error thrown by SecondLayer when an API request fails.
│  ├─ AuthError 401
│  ├─ RateLimitError 429
│  ├─ StreamsServerError Thrown on a 5xx from the Streams API, and on a failed signing-key fetch.
│  └─ ValidationError Thrown on a 4xx the caller can fix (bad cursor, bad params).
├─ ArchiveAuthError Thrown on a 401 from the archive ops host (quote/fetch/credits).
├─ ArchiveGateNotConfiguredError Thrown on a 503 when the archive fetch gate is unconfigured.
├─ ArchiveSignatureError Thrown when an archive manifest signature is missing or does not verify.
├─ InsufficientArchiveCreditsError Thrown on a 402 from archive fetch — prepaid credits do not cover the quote.
└─ StreamsSignatureError Thrown when response signature verification is enabled and fails.
ApiErrorextends SecondLayerErrorError thrown by SecondLayer when an API request fails.
ArchiveAuthErrorextends SecondLayerErrorThrown on a 401 from the archive ops host (quote/fetch/credits).
ArchiveGateNotConfiguredErrorextends SecondLayerErrorThrown on a 503 when the archive fetch gate is unconfigured.
ArchiveSignatureErrorextends SecondLayerErrorThrown when an archive manifest signature is missing or does not verify.
AuthErrorextends ApiError · 401Thrown on a 401 by both the instance clients and Streams.
InsufficientArchiveCreditsErrorextends SecondLayerErrorThrown on a 402 from archive fetch — prepaid credits do not cover the quote.
RateLimitErrorextends ApiError · 429Thrown on a 429 by both the instance clients and Streams.
StreamsServerErrorextends ApiErrorThrown on a 5xx from the Streams API, and on a failed signing-key fetch.
StreamsSignatureErrorextends SecondLayerErrorThrown when response signature verification is enabled and fails.
ValidationErrorextends ApiErrorThrown on a 4xx the caller can fix (bad cursor, bad params).
Edit on GitHub