diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-13 16:06:19 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-13 16:08:15 -0400 |
commit | f8e666b70c9d114f3469c7c21d41474faac00c13 (patch) | |
tree | b21123e992d639a4c3a8c1947c42c3a07dd05254 /ext/bg/js | |
parent | f3ab7673f98f8721030d5513459e5e842b812e80 (diff) |
Fix backend handling errors incorrectly
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/backend.js | 7 |
1 files changed, 4 insertions, 3 deletions
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; |