From 8a94978bb9f62d7cad5c2d5344dfb48d0c9f5645 Mon Sep 17 00:00:00 2001 From: William Toohey Date: Fri, 26 Feb 2016 22:14:13 +1000 Subject: [PATCH] Stop hiding a failure state, fixes a race --- src/js/SoundManager.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/js/SoundManager.js b/src/js/SoundManager.js index 945253d..9126259 100644 --- a/src/js/SoundManager.js +++ b/src/js/SoundManager.js @@ -170,7 +170,7 @@ SoundManager.prototype.playSong = function(song, playBuild, forcePlay) { }).then(buffers => { // To prevent race condition if you press "next" twice fast if(song != this.song) { - // Stop processing - silently ignored in the catch below + // Stop processing throw { name: "SoundManagerRace", message: "Song not playable - ignoring!" @@ -194,15 +194,6 @@ SoundManager.prototype.playSong = function(song, playBuild, forcePlay) { return this.context.resume(); }).then(() => { this.playing = true; - }).catch(error => { - if(error.name == "SoundManagerRace") { - // Just to ignore it if the song was invalid - // Log it in case it's something weird - console.log("SoundManager couldn't play song", error); - return; - } else { - throw error; - } }); return p; };