Skip to content

EZ Web Audio / AggregateAudioLoadError

Class: AggregateAudioLoadError

Defined in: packages/core/src/errors/load-error.ts:61

Error thrown when preload() fails to load one or more URLs in a batch.

Extends AudioError (so instanceof AudioError still matches — see the catch-all pattern documented there) while preserving the individual per-URL failures via errors, so callers that need to know exactly which URLs failed (and why) don't have to string-parse the aggregate message.

Example

typescript
try {
  await preload(['a.mp3', 'b.mp3']);
} catch (e) {
  if (e instanceof AggregateAudioLoadError) {
    for (const err of e.errors) {
      console.error(`Failed: ${err.url} — ${err.message}`);
    }
  }
}

Extends

Constructors

Constructor

new AggregateAudioLoadError(message, errors): AggregateAudioLoadError

Defined in: packages/core/src/errors/load-error.ts:68

Create a new AggregateAudioLoadError.

Parameters

message

string

Human-readable summary of the batch failure

errors

AudioLoadError[]

The individual per-URL AudioLoadError failures

Returns

AggregateAudioLoadError

Overrides

AudioError.constructor

Properties

code?

readonly optional code: string

Defined in: packages/core/src/errors/audio-error.ts:34

Optional error code for programmatic handling

Inherited from

AudioError.code


errors

readonly errors: AudioLoadError[]

Defined in: packages/core/src/errors/load-error.ts:70

The individual per-URL AudioLoadError failures