From 80343227bcb259e53c8bec2142bfa27cbfdf4dc4 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 14 Jan 2014 16:00:05 -0300 Subject: [PATCH] call callback on connection error --- RpcClient.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RpcClient.js b/RpcClient.js index 5e3b78e..959ea31 100644 --- a/RpcClient.js +++ b/RpcClient.js @@ -180,7 +180,9 @@ function ClassSpec(b) { }); }); req.on('error', function(e) { - log.err('Could not connect to bitcoin via RPC: '+e); + var err = new Error('Could not connect to bitcoin via RPC: '+e.message); + log.err(err); + callback(err); }); req.setHeader('Content-Length', request.length);