rpcclient: fix error messages.
This commit is contained in:
parent
a278146a33
commit
634e1603a4
@ -64,6 +64,9 @@ RPCClient.prototype.call = function call(method, params, callback) {
|
|||||||
if (!body)
|
if (!body)
|
||||||
return callback();
|
return callback();
|
||||||
|
|
||||||
|
if (res.statusCode === 400)
|
||||||
|
return callback(null, body.result);
|
||||||
|
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
if (body.error)
|
if (body.error)
|
||||||
return callback(new Error(body.error.message));
|
return callback(new Error(body.error.message));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user