Skip to main content
The SDK throws typed errors for API failures, validation issues, and network problems. The taxonomy mirrors the API’s ErrorResponse envelope, with subclasses per HTTP class for ergonomic catching.

Error class hierarchy

All classes are importable from the package root:

DevhelmApiError

The most common error class — thrown for any non-2xx HTTP response.

DevhelmValidationError

Thrown before HTTP I/O when a request body fails the Zod schema, and after a successful response when the response body doesn’t match the expected schema (rare — usually indicates a stale SDK).

DevhelmTransportError

Thrown for network-level failures (connection refused, DNS, TLS handshake, timeout). The original fetch error is on .cause.

Handling patterns

Catch by HTTP class

Retry on rate limits and 5xx

Don’t retry on DevhelmValidationError, DevhelmAuthError, DevhelmNotFoundError, or DevhelmConflictError — these are deterministic and won’t change without code or config changes.

Deploy lock contention

Catch-all logging

Wait timeouts

client.inboxes.wait, inbox.wait, client.email.wait, and address.wait hold the request open until a match arrives. These are the errors they and the other testing calls throw:
  • There is no timeout subclass. A 408 is a plain DevhelmApiError, so check code, and test for DevhelmRateLimitError first.
  • The SDK does not retry. Retrying a wait is safe: wait does not consume, so the same receivedAfter finds the same item.
  • The HTTP call is aborted 10 seconds after timeoutMs, so the 408 arrives first. Set your test runner’s timeout above timeoutMs.
A negative assertion spends one wait from the shared budget. Give it a timeout that covers your sender’s latency plus a few seconds of storage lag. See Wait for a webhook in a test and Limits, quotas, and errors.

Next steps

Pagination

Iterate through paginated results.

Error patterns

Common error scenarios across all surfaces.