Whistle API
    Preparing search index...

    Class WhistleError

    SDK failure with a stable code and optional local cause.

    Branch on code instead of parsing messages. Worker transport retains the code and message but does not copy arbitrary stacks, causes, audio or transcript objects.

    import { WhistleError } from '@tiny-stt/whistle';
    function wasCancelled(error: unknown) {
    return error instanceof WhistleError && error.code === 'ABORTED';
    }

    Hierarchy

    • Error
      • WhistleError
    Index
    • Construct an SDK error or attach a local underlying cause.

      Parameters

      • code:
            | "UNSUPPORTED_ENVIRONMENT"
            | "INVALID_OPTIONS"
            | "INVALID_AUDIO"
            | "AUDIO_TOO_LONG"
            | "AUDIO_DECODE_FAILED"
            | "MICROPHONE_DENIED"
            | "MICROPHONE_UNAVAILABLE"
            | "ASSET_NOT_FOUND"
            | "ASSET_DOWNLOAD_FAILED"
            | "ASSET_INTEGRITY_FAILED"
            | "ASSET_INCOMPATIBLE"
            | "MODEL_LOAD_FAILED"
            | "INFERENCE_FAILED"
            | "INVALID_ENGINE_OUTPUT"
            | "WORKER_FAILED"
            | "OUT_OF_MEMORY"
            | "ABORTED"
            | "DISPOSED"

        Stable machine-readable failure category.

      • message: string

        Human-readable context; never include caller audio or transcripts.

      • Optionaloptions: ErrorOptions

        Optional native Error cause (not preserved across workers).

      Returns WhistleError

    code:
        | "UNSUPPORTED_ENVIRONMENT"
        | "INVALID_OPTIONS"
        | "INVALID_AUDIO"
        | "AUDIO_TOO_LONG"
        | "AUDIO_DECODE_FAILED"
        | "MICROPHONE_DENIED"
        | "MICROPHONE_UNAVAILABLE"
        | "ASSET_NOT_FOUND"
        | "ASSET_DOWNLOAD_FAILED"
        | "ASSET_INTEGRITY_FAILED"
        | "ASSET_INCOMPATIBLE"
        | "MODEL_LOAD_FAILED"
        | "INFERENCE_FAILED"
        | "INVALID_ENGINE_OUTPUT"
        | "WORKER_FAILED"
        | "OUT_OF_MEMORY"
        | "ABORTED"
        | "DISPOSED"

    Stable category for application branching.

    name: "WhistleError" = 'WhistleError'

    Error name used by diagnostics and native Error tooling.