Errors¶
The SDK separates local request/configuration errors from HTTP API errors.
Local errors¶
ConfigurationError: missing or invalid client configuration.RequestValidationError: a request violates a documented OpenAPI constraint before HTTP is sent.TransportError: no usable HTTP response was received.
HTTP errors¶
AuthenticationError— 401AuthorizationError— 403NotFoundError— 404ValidationError— 422RateLimitError— 429ApiError— other non-success HTTP errors
try {
await client.projects.createTicket(projectId, { title: '' });
} catch (error) {
if (error instanceof RequestValidationError) {
console.error(error.issues);
}
}
Laravel validation errors are exposed as validationErrors:
try {
await client.tickets.update(ticketId, { priority: 'high' });
} catch (error) {
if (error instanceof ValidationError) {
console.error(error.status, error.validationErrors);
}
}
RateLimitError.retryAfterMs is populated when the server returns a usable Retry-After header.