add UPGRADENEEDED error code

This commit is contained in:
Ivan Socolsky 2015-07-30 16:08:17 -03:00
parent b659333c94
commit 86779303a9
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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();
});
});