Fix backend handling errors incorrectly
This commit is contained in:
parent
f3ab7673f9
commit
f8e666b70c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user