From 3f80001e4d2143344f13b3ddeaf89e0e7a65993a Mon Sep 17 00:00:00 2001 From: ricmoo Date: Thu, 4 Aug 2016 17:53:44 -0400 Subject: [PATCH] On failed RPC, include original error and data. --- lib/providers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/providers.js b/lib/providers.js index 7aaf7a7f..7ac8c116 100644 --- a/lib/providers.js +++ b/lib/providers.js @@ -64,8 +64,10 @@ function rpcSendAsync(url) { try { callback(null, JSON.parse(result)); } catch (error) { - console.log(error); - callback(new Error('invalid response')); + var responseError = new Error('invalid response'); + responseError.orginialError = error; + responseError.data = result; + callback(responseError); } };