add UPGRADENEEDED error code
This commit is contained in:
parent
b659333c94
commit
86779303a9
|
@ -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) {
|
||||
|
|
|
@ -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…
Reference in New Issue