diff options
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; |