On failed RPC, include original error and data.
This commit is contained in:
parent
89082164ce
commit
3f80001e4d
@ -64,8 +64,10 @@ function rpcSendAsync(url) {
|
|||||||
try {
|
try {
|
||||||
callback(null, JSON.parse(result));
|
callback(null, JSON.parse(result));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
var responseError = new Error('invalid response');
|
||||||
callback(new Error('invalid response'));
|
responseError.orginialError = error;
|
||||||
|
responseError.data = result;
|
||||||
|
callback(responseError);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user