Error Handling
Handle errors gracefully in your Scribeberry integration.
The Scribeberry SDK throws typed errors that you can catch and handle specifically. All errors extend the base ScribeberryError class.
Error Classes
ScribeberryError
The base class for all SDK errors. Contains a machine-readable code and optional HTTP status.
AuthenticationError
Thrown when the API key or token is invalid, expired, or missing.
RateLimitError
Thrown when you exceed the rate limit for your project.
Error Codes
REST API Errors
| Code | Status | Description |
|---|---|---|
AUTHENTICATION_ERROR | 401 | Invalid or expired API key |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
MISSING_API_KEY | — | No API key provided |
INVALID_API_KEY_FORMAT | — | Key doesn't match expected prefix |
INVALID_TOKEN_SCOPE | — | Temp token used for REST call |
TIMEOUT | 408 | Request timed out |
NETWORK_ERROR | — | Network connectivity issue |
HTTP_400 | 400 | Bad request (check parameters) |
HTTP_404 | 404 | Resource not found |
HTTP_500 | 500 | Server error |
Realtime/WebSocket Errors
| Code | Description |
|---|---|
CONNECTION_ERROR | Failed to establish WebSocket connection |
CONNECTION_CLOSED | WebSocket closed unexpectedly |
CONNECT_TIMEOUT | Server didn't acknowledge session within 10s |
SESSION_STATE_ERROR | Operation invalid for current session state |
AUTH_REQUIRED | WebSocket connection missing authentication |
AUTH_INVALID | WebSocket authentication failed |
SESSION_START_FAILED | Server failed to start transcription session |
PROVIDER_ERROR | Transcription provider returned an error |
NO_SESSION | Tried to stop a session that doesn't exist |
SERVER_ONLY | Attempted server-only operation in browser |
Retry Strategy
For production integrations, implement exponential backoff:
Realtime Error Handling
For WebSocket sessions, handle errors via the error event:
REST API Error Response Format
When calling the API directly (without the SDK), errors are returned as JSON: