diff --git a/lib/server.js b/lib/server.js index b508368..0488241 100644 --- a/lib/server.js +++ b/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) { diff --git a/test/integration/server.js b/test/integration/server.js index 1df33a5..70e89eb 100644 --- a/test/integration/server.js +++ b/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(); }); });