voice-pipeline/VoiceInterruptError.ts

agentos · src/io/voice-pipeline/VoiceInterruptError.ts · typescript · Apache-2.0
voice

* @module voice-pipeline/VoiceInterruptError Typed error thrown when a voice session is interrupted by user barge-in. Used by VoiceNodeExecutor to catch barge-in AbortSignal and return a structured result instead of propagating a generic Error. ## Design rationale

// Source: https://github.com/framerslab/agentos | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * @module voice-pipeline/VoiceInterruptError
 *
 * Typed error thrown when a voice session is interrupted by user barge-in.
 * Used by VoiceNodeExecutor to catch barge-in AbortSignal and return
 * a structured result instead of propagating a generic Error.
 *
 * ## Design rationale
 *
 * Using a typed error subclass (rather than a plain Error with a message string)
 * allows consumers to:
 * 1. Catch specifically via `instanceof VoiceInterruptError`.
 * 2. Access structured fields (`interruptedText`, `userSpeech`,
 *    `playedDurationMs`) without parsing an error message.
 * 3. Distinguish barge-in interruptions from other pipeline errors in
 *    ca

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key