Skip to content

docs: expand and improve error handling documentation (#96) - #240

Merged
ccampbell-aai merged 2 commits into
AssemblyAI:masterfrom
pylrn:docs/error-handling-guide-96
Sep 16, 2026
Merged

ccampbell-aai merged 2 commits into
AssemblyAI:masterfrom
pylrn:docs/error-handling-guide-96

Conversation

@pylrn

@pylrn pylrn commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #96

This PR expands and clarifies error handling documentation across the SDK:

  • Exception Hierarchy: Documents the full custom exception hierarchy (AssemblyAIError, TranscriptError, SyncTranscriptError, RedactedAudioIncompleteError, RedactedAudioExpiredError, RedactedAudioUnavailableError, and RealTimeError/StreamingError) along with their respective attributes.
  • Handling Patterns: Provides concrete examples for differentiating error cases using try...except, validating transcript statuses (aai.TranscriptStatus.error), inspecting HTTP status codes, and accessing raw response headers/body via Client.get_default().last_response.
  • Sync STT Errors: Documents SyncTranscriptError.error_code strings and retry_after timing for 429/503 responses.
  • Streaming Errors: Documents how WebSocket streaming errors are dispatched to RealTimeEvents.Error handlers and mapped via RealTimeErrorCodes.
  • Table of Contents Sync: Updated the Table of Contents anchor to match the expanded section.

@ccampbell-aai ccampbell-aai added the skip-version-bump PR intentionally ships no release; bypasses the Version Bump Check label Sep 8, 2026

@ccampbell-aai ccampbell-aai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to give detail on these exceptions! I've left a few minor suggestions and improvements but overall this is very well done.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
- Note that the streaming RealTimeError does not inherit from AssemblyAIError
- Clarify when TranscriptError is raised (HTTP-level failure or polling timeout)
- Reference the RedactedAudio*Error classes via assemblyai.types, since they
  are not exported at the top level

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ccampbell-aai

Copy link
Copy Markdown
Contributor

Thanks again for this! I pushed a commit to your branch addressing the three review comments (RealTimeError inheritance note, TranscriptError wording, and assemblyai.types. paths for the RedactedAudio*Error classes) so we can get this merged.

@ccampbell-aai
ccampbell-aai merged commit 1827dd8 into AssemblyAI:master Sep 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-version-bump PR intentionally ships no release; bypasses the Version Bump Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation for handling errors

2 participants