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 SecondLayerError | Error thrown by SecondLayer when an API request fails. |
ArchiveAuthErrorextends SecondLayerError | Thrown on a 401 from the archive ops host (quote/fetch/credits). |
ArchiveGateNotConfiguredErrorextends SecondLayerError | Thrown on a 503 when the archive fetch gate is unconfigured. |
ArchiveSignatureErrorextends SecondLayerError | Thrown when an archive manifest signature is missing or does not verify. |
AuthErrorextends ApiError · 401 | Thrown on a 401 by both the instance clients and Streams. |
InsufficientArchiveCreditsErrorextends SecondLayerError | Thrown on a 402 from archive fetch — prepaid credits do not cover the quote. |
RateLimitErrorextends ApiError · 429 | Thrown on a 429 by both the instance clients and Streams. |
StreamsServerErrorextends ApiError | Thrown on a 5xx from the Streams API, and on a failed signing-key fetch. |
StreamsSignatureErrorextends SecondLayerError | Thrown when response signature verification is enabled and fails. |
ValidationErrorextends ApiError | Thrown on a 4xx the caller can fix (bad cursor, bad params). |