transaction: update error handling with codes
This commit is contained in:
parent
04b0b39049
commit
d47527e7d0
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user