Display more information about decoding errors.
[pwl6.git] / src / yuu / audio.js
index cc00cf7..6b971a1 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()));
                     });
                 });
             }