Skip to content

Commit 56cd59c

Browse files
committed
Throw error for a bad audio asset key
1 parent 819a6b2 commit 56cd59c

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ var HTML5AudioSound = new Class({
4747

4848
if (!this.tags)
4949
{
50-
// eslint-disable-next-line no-console
51-
console.warn('Audio cache entry missing: ' + key);
52-
return;
50+
throw new Error('There is no audio asset with key "' + key + '" in the audio cache');
5351
}
5452

5553
/**

src/sound/webaudio/WebAudioSound.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ var WebAudioSound = new Class({
4545

4646
if (!this.audioBuffer)
4747
{
48-
// eslint-disable-next-line no-console
49-
console.warn('Audio cache entry missing: ' + key);
50-
return;
48+
throw new Error('There is no audio asset with key "' + key + '" in the audio cache');
5149
}
5250

5351
/**

0 commit comments

Comments
 (0)