Display more information about decoding errors.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 2 Aug 2015 11:58:02 +0000 (13:58 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 2 Aug 2015 11:58:02 +0000 (13:58 +0200)
src/yuu/audio.js

index cc00cf7424ada80841e8b8b32f160090804d6c56..6b971a1edb66ceb6c58a4f520206c3b1e7f9ff79 100644 (file)
                 return new Promise(function (resolve, reject) {
                     ctx.decodeAudioData(data, function (buffer) {
                         resolve(buffer);
-                    }, function () {
+                    }, function (err) {
                         reject(new Error("Error decoding audio buffer"
-                                         + (hint ? ": " + hint : "")));
+                                         + (hint ? ": " + hint : "")
+                                         + ": " + err.toString()));
                     });
                 });
             }