Reference
Errors
Handle Domain0 API, transport, protocol, and validation failures.
The SDK separates four failure boundaries:
| Error | Meaning |
|---|---|
z.ZodError | Your local input does not match a public contract |
Domain0TransportError | The request could not reach Domain0 |
Domain0ProtocolError | The response was not valid Domain0 JSON |
Domain0Error | Domain0 returned a valid public API error |
try {
await platform.getConnection(connectionId)
} catch (error) {
if (error instanceof Domain0Error) {
const { code, requestId, retryable } = error.response.error
console.error({ code, requestId, retryable })
}
}API error codes
| Code | Meaning | Recommended action |
|---|---|---|
invalid_request | Input failed validation | Fix the request; do not retry unchanged input |
unauthorized | Authentication is missing or invalid | Replace the server key or refresh browser access |
forbidden | The credential cannot access this resource or origin | Check application ownership, connection scope, and exact origin |
not_found | The application-owned resource does not exist | Verify the saved ID; create a new connection when appropriate |
conflict | The command does not match current connection state | Retrieve current state before choosing the next action |
rate_limited | The request rate is too high | Wait for the response retry guidance before retrying |
dns_unavailable | Authoritative DNS evidence is temporarily unavailable | Retry only when retryable is true |
provider_unavailable | The selected provider path is temporarily unavailable | Retry or continue through guided setup |
provider_authorization_failed | Provider consent or credentials were rejected | Let the customer authorize again |
provider_limitation | The provider cannot perform the requested automatic operation | Use the guided provider path |
plan_expired | The reviewed DNS plan is no longer current | Prepare and review a fresh plan |
propagation_pending | Required records are not yet authoritative everywhere | Keep the connection and verify again later |
internal_error | Domain0 could not complete the operation | Retry only when retryable is true and retain requestId |
Safe logging
Log the error code, HTTP status, requestId, connection ID, and operation name.
Never log API keys, browser bearer tokens, webhook secrets, signatures, or
provider credential fields.