Skip to main content

Overview

The RecallrAI SDK implements a consistent exception hierarchy to help you handle errors gracefully. All SDK exceptions inherit from RecallrAIError.

Importing Exceptions

import {
  RecallrAIError,
  AuthenticationError,
  TimeoutError,
  ConnectionError,
  InternalServerError,
  RateLimitError,
  UserNotFoundError,
  UserAlreadyExistsError,
  SessionNotFoundError,
  InvalidSessionStateError,
  MergeConflictNotFoundError,
} from "recallrai";

Base Exception

try {
  await client.getUser("user123");
} catch (error) {
  if (error instanceof RecallrAIError) {
    console.log(`RecallrAI error: ${error.message}`);
  }
}

Common Errors

  • AuthenticationError: Invalid API key or project ID
  • TimeoutError: Request timed out
  • ConnectionError: Network connectivity issues
  • InternalServerError: API returned a 5xx error
  • RateLimitError: Too many requests
  • UserNotFoundError: User does not exist
  • SessionNotFoundError: Session does not exist
  • InvalidSessionStateError: Invalid session status for operation
  • MergeConflictNotFoundError: Merge conflict was not found