2
0
mirror of synced 2025-02-24 12:08:10 +00:00

On failed RPC, include original error and data.

This commit is contained in:
ricmoo 2016-08-04 17:53:44 -04:00
parent 89082164ce
commit 3f80001e4d

View File

@ -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);
} }
}; };