1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

minor cleanup on error handlers

This commit is contained in:
Tankred Hase 2013-11-14 21:39:20 +01:00
parent 4b8f4ee7df
commit f23dee9369
4 changed files with 8 additions and 13 deletions

View File

@ -324,8 +324,9 @@ define(function(require) {
uuid = email.body.substr(index + consts.verificationUrlPrefix.length, consts.verificationUuidLength);
self._keychain.verifyPublicKey(uuid, function(err) {
if (err) {
console.error('Unable to verify public key: ' + err.errMsg);
localCallback();
callback({
errMsg: 'Verifying your public key failed: ' + err.errMsg
});
return;
}

View File

@ -14,14 +14,7 @@ define(function() {
this._restDao.get({
uri: uri,
type: 'text'
}, function(err) {
if (err) {
callback(err);
return;
}
callback();
});
}, callback);
};
/**

View File

@ -28,9 +28,9 @@ define(function() {
}
function onError(e) {
console.error(e);
callback({
errMsg: 'Error exporting keypair to file!'
errMsg: 'Error exporting keypair to file!',
err: e
});
}

View File

@ -696,6 +696,7 @@ define(function(require) {
done();
});
});
it('should not mark verification mails read if verification fails', function(done) {
devicestorageStub.listItems.yields(null, [verificationMail]);
keychainStub.verifyPublicKey.yields({
@ -707,7 +708,7 @@ define(function(require) {
offset: 0,
num: 1
}, function(err) {
expect(err).to.not.exist;
expect(err).to.exist;
expect(devicestorageStub.listItems.calledOnce).to.be.true;
expect(keychainStub.verifyPublicKey.calledOnce).to.be.true;
done();