diff --git a/RpcClient.js b/RpcClient.js index b8948e1fa..80a197260 100644 --- a/RpcClient.js +++ b/RpcClient.js @@ -164,9 +164,14 @@ function ClassSpec(b) { }); res.on('end', function() { if(res.statusCode == 401) { - callback(new Error('bitcoin JSON-RPC connection rejected: unauthorized')); + callback(new Error('bitcoin JSON-RPC connection rejected: 401 unauthorized')); return; } + if(res.statusCode == 403) { + callback(new Error('bitcoin JSON-RPC connection rejected: 403 forbidden')); + return; + } + if(err) { callback(err); return; @@ -176,6 +181,7 @@ function ClassSpec(b) { } catch(e) { log.err(e.stack); log.err(buf); + log.err('HTTP Status code:' + res.statusCode); callback(e); return; }