Browse Source

add UPGRADENEEDED error code

activeAddress
Ivan Socolsky 10 years ago
parent
commit
86779303a9
  1. 2
      lib/server.js
  2. 3
      test/integration/server.js

2
lib/server.js

@ -1396,7 +1396,7 @@ WalletService.prototype.getPendingTxs = function(opts, cb) {
return _.startsWith(txp.version, '1.');
});
if (!allLegacy) return cb(new Error('Some spend proposals were created using a newer version. Please upgrade your client app.'))
if (!allLegacy) return cb(new ClientError('UPGRADENEEDED', 'Some spend proposals were created using a newer version of the client app'));
}
_.each(txps, function(txp) {

3
test/integration/server.js

@ -4309,7 +4309,8 @@ describe('Wallet service', function() {
server.getPendingTxs({}, function(err, txps) {
should.exist(err);
should.not.exist(txps);
err.toString().should.contain('created by a newer version');
err.code.should.equal('UPGRADENEEDED');
err.message.should.contain('newer version');
done();
});
});

Loading…
Cancel
Save