Merge pull request #28 from matiu/feature/handle-403-HTTP
handle 403 status code
This commit is contained in:
commit
be55042c44
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue