Browse Source

add TX_NOT_FOUND

activeAddress
Ivan Socolsky 10 years ago
parent
commit
e4e138e139
  1. 1
      lib/errors/errordefinitions.js
  2. 2
      lib/server.js
  3. 3
      test/integration/server.js

1
lib/errors/errordefinitions.js

@ -21,6 +21,7 @@ var errors = {
TX_CANNOT_CREATE: 'Cannot create TX proposal during backoff time',
TX_CANNOT_REMOVE: 'Cannot remove this tx proposal during locktime',
TX_NOT_ACCEPTED: 'The transaction proposal is not accepted',
TX_NOT_FOUND: 'Transaction proposal not found',
TX_NOT_PENDING: 'The transaction proposal is not pending',
UPGRADE_NEEDED: 'Client app needs to be upgraded',
WALLET_ALREADY_EXISTS: 'Wallet already exists',

2
lib/server.js

@ -1085,7 +1085,7 @@ WalletService.prototype.getTx = function(opts, cb) {
self.storage.fetchTx(self.walletId, opts.txProposalId, function(err, txp) {
if (err) return cb(err);
if (!txp) return cb(new ClientError('Transaction proposal not found'));
if (!txp) return cb(Errors.TX_NOT_FOUND);
return cb(null, txp);
});
};

3
test/integration/server.js

@ -2907,7 +2907,8 @@ describe('Wallet service', function() {
}, function(err, txp) {
should.exist(err);
should.not.exist(txp);
err.message.should.contain('not found');
err.code.should.equal('TX_NOT_FOUND')
err.message.should.equal('Transaction proposal not found');
done();
});
});

Loading…
Cancel
Save