From f8e666b70c9d114f3469c7c21d41474faac00c13 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 13 Oct 2019 16:06:19 -0400 Subject: Fix backend handling errors incorrectly --- ext/bg/js/backend.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index c1216d95..32ff1bef 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -73,9 +73,10 @@ class Backend { if (handlers.hasOwnProperty(action)) { const handler = handlers[action]; const promise = handler(params, sender); - promise - .then(result => callback({result})) - .catch(error => callback(errorToJson(error))); + promise.then( + result => callback({result}), + error => callback({error: errorToJson(error)}) + ); } return true; -- cgit v1.2.3