Error Handling
Devloom throws typed errors with structured context. Import and catch them for clean error handling.
Error types
import {
DlxAuthError,
DlxRateLimitError,
DlxConnectorError,
DlxNetworkError
} from 'devloom';
Catching errors
try {
const records = await client.query('orders').all();
} catch (e) {
if (e instanceof DlxAuthError) {
// Token expired or invalid
} else if (e instanceof DlxRateLimitError) {
// Exhausted retries
} else if (e instanceof DlxConnectorError) {
console.error(e.statusCode, e.message);
}
}
Error properties
| Property | Type | Description |
|---|---|---|
code | string | Machine-readable error code |
message | string | Human-readable description |
statusCode | number | HTTP status from upstream |
connector | string | Connector slug that threw |
requestId | string | Upstream request ID for debugging |