Fix backend handling errors incorrectly

This commit is contained in:
toasted-nutbread 2019-10-13 16:06:19 -04:00
parent f3ab7673f9
commit f8e666b70c

View File

@ -73,9 +73,10 @@ class Backend {
if (handlers.hasOwnProperty(action)) { if (handlers.hasOwnProperty(action)) {
const handler = handlers[action]; const handler = handlers[action];
const promise = handler(params, sender); const promise = handler(params, sender);
promise promise.then(
.then(result => callback({result})) result => callback({result}),
.catch(error => callback(errorToJson(error))); error => callback({error: errorToJson(error)})
);
} }
return true; return true;