Error Handling
Handle API errors with typed exceptions and built-in retry logic in the Platform SDK.
Error Types
import {
AmigoError,
AuthenticationError,
PermissionError,
NotFoundError,
BadRequestError,
ValidationError,
ConflictError,
RateLimitError,
ServerError,
ServiceUnavailableError,
NetworkError,
RequestTimeoutError,
ParseError,
ConfigurationError,
} from '@amigo-ai/platform-sdk'
// Available error classes:
AmigoError // Base class for request-path SDK errors
AuthenticationError // 401, invalid or expired API key
PermissionError // 403, insufficient permissions
NotFoundError // 404, resource does not exist
BadRequestError // 400, invalid request format or parameters
ValidationError // 422, request validation failed
ConflictError // 409, resource conflict (for example, duplicate name)
RateLimitError // 429, rate limited (exposes .retryAfter)
ServerError // Fallback for other HTTP statuses, including unmapped 4xx and 5xx responses
ServiceUnavailableError // 503, service temporarily unavailable (extends ServerError)
NetworkError // Connection failure, no HTTP status available
RequestTimeoutError // Request exceeded configured timeout (exposes .timeoutMs, extends NetworkError)
ParseError // Response body could not be parsed (exposes .body)
ConfigurationError // Invalid client config (e.g. missing apiKey or workspaceId)Property
Type
Description
Basic Error Handling
Common Error Scenarios
Authentication Errors
Not Found Errors
Conflict Errors
Validation Errors
Built-in Retry Logic
Failure
Retry Behavior
Best Practices
Next Steps
Last updated
Was this helpful?

