From 634e1603a41647f71bb09340bfabaac90eead1c7 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 15 Aug 2016 20:00:28 -0700 Subject: [PATCH] rpcclient: fix error messages. --- lib/bcoin/http/rpcclient.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bcoin/http/rpcclient.js b/lib/bcoin/http/rpcclient.js index d3bc34f7..5f8a2812 100644 --- a/lib/bcoin/http/rpcclient.js +++ b/lib/bcoin/http/rpcclient.js @@ -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));