Docs / Error Handling

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

PropertyTypeDescription
codestringMachine-readable error code
messagestringHuman-readable description
statusCodenumberHTTP status from upstream
connectorstringConnector slug that threw
requestIdstringUpstream request ID for debugging