Skip to main content

Error Handling

The Skribble SDK provides structured error handling with specific error types for different scenarios. This guide explains the error types and how to handle them effectively.

Error Types

Base Error

SkribbleError is the base error class that all other SDK errors inherit from. It provides:
  • message: A descriptive error message

Authentication Error

SkribbleAuthError is thrown specifically for authentication failures:

API Error

SkribbleAPIError is thrown when the Skribble API returns an error response:

Validation Error

SkribbleValidationError is thrown for input validation failures:

Operation Error

SkribbleOperationError (Python only) provides detailed context about operation failures:

Error Handling Best Practices

  • Authentication Errors: Re-authenticate or refresh credentials
  • Validation Errors: Fix the invalid data based on the error details
  • API Errors: Handle based on status code (retry for 5xx, fix request for 4xx)
  • Operation Errors: Log details and handle based on the specific operation

Common Error Scenarios

Authentication Failures

Invalid Request Data

API Rate Limiting

Helper Functions

Python Error Handler

TypeScript Error Handler

Learn more

Error handlling guide

Learn how to handle errors in the Skribble SDK