Skip to main content

Error Handling with tryCatch

The R SDK uses R’s condition system for error handling. Use tryCatch to handle specific error types:

Error Types

The SDK defines the following error conditions:

Error Properties

All errors include helpful properties:

Rate Limiting

Handle rate limits with retry logic:
The SDK automatically retries failed requests up to max_retries times (default: 3) with exponential backoff. You typically don’t need to handle transient errors manually.

Connection Errors

Handle network issues:

Best Practices

Catch Specific Errors First

Use withCallingHandlers for Logging

Wrap in a Safe Function

Create a helper function for common error handling: