From d47527e7d0d96ba753dddf15dab2c2c6b01e2a11 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 15 Apr 2016 11:43:48 -0400 Subject: [PATCH] transaction: update error handling with codes --- lib/transactions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transactions.js b/lib/transactions.js index f16b681..72320b9 100644 --- a/lib/transactions.js +++ b/lib/transactions.js @@ -25,7 +25,7 @@ TxController.prototype.transaction = function(req, res, next, txid) { var self = this; this.node.getTransactionWithBlockInfo(txid, function(err, transaction) { - if (err && err instanceof self.node.errors.Transaction.NotFound) { + if (err && err.code === -5) { return common.handleErrors(null, res); } else if(err) { return common.handleErrors(err, res); @@ -193,7 +193,7 @@ TxController.prototype.rawTransaction = function(req, res, next, txid) { var self = this; this.node.getTransaction(txid, function(err, transaction) { - if (err && err instanceof self.node.errors.Transaction.NotFound) { + if (err && err.code === -5) { return common.handleErrors(null, res); } else if(err) { return common.handleErrors(err, res);