Skip to main content
The Vela SDK uses a typed error hierarchy rooted at VelaError. Every API error response is wrapped in a specific subclass so you can handle different failure modes independently.

Error class hierarchy

Any other 4xx or 5xx response is thrown as the base VelaError.

Basic error handling

Error properties

Every VelaError instance includes:
Example:

Network errors

Network errors — DNS failures, connection timeouts, connection refused — are not wrapped in VelaError. They propagate as native TypeError or DOMException. This distinction lets you handle transport failures separately from API errors:

Handling validation errors on ingestion

When an event fails schema validation, Vela returns a 400 with a specific message describing which field failed:

Rate limit handling

When you hit a rate limit (429), implement exponential backoff before retrying:

Auth errors