Skip to main content
The SDK provides a comprehensive error hierarchy for different failure scenarios.

Error Hierarchy

Basic Error Handling

Error Properties

All errors extend ComplianceError with these properties:

Validation Errors

Validation errors occur when input data fails schema validation:

Validation Issue Structure

API Errors

API errors include HTTP status information:

Not Found Error

Unauthorized Error

Forbidden Error

Rate Limit Error

Server Error

Network Error

Timeout Error

Upload Errors

Handle file upload failures:

Type Guards

Use type guards for cleaner error handling:

Error Serialization

All errors can be serialized to JSON:

Best Practices

Catch Specific Errors First

Retry with Backoff