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)
|
||||
return callback();
|
||||
|
||||
if (res.statusCode === 400)
|
||||
return callback(null, body.result);
|
||||
|
||||
if (res.statusCode !== 200) {
|
||||
if (body.error)
|
||||
return callback(new Error(body.error.message));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user