rpcclient: fix error messages.

This commit is contained in:
Christopher Jeffrey 2016-08-15 20:00:28 -07:00
parent a278146a33
commit 634e1603a4
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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));