From 9625c9a072e2b8df1ffe8c028bbdb64701b87183 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 3 Mar 2015 22:10:27 +0100 Subject: [PATCH] Don't swallow errors in promises --- data/js/tomahawk.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index e15b58ccd..0566272eb 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -42,6 +42,13 @@ Tomahawk.apiVersion = "0.2.2"; // install RSVP.Promise as global Promise if(window.Promise === undefined) { window.Promise = window.RSVP.Promise; + window.RSVP.on('error', function(reason) { + if (reason) { + console.error(reason.message, reason); + } else { + console.error('Error: error thrown from RSVP but it was empty'); + } + }); } /**