Remove libaxolotl dependency on textsecure/errors.js

Let libaxolotl throw a generic error instead of a replayable error, and
add an helper function in libtextsecure's axolotl_wrapper to catch and
convert from the generic error to the replayable one. This allows the
ReplayableError to remain a libtextsecure-level concept only.

Somewhat unrelatedly, but nearby, fix some whitespace and add missing
semicolon.
This commit is contained in:
lilia
2015-02-19 14:53:08 -08:00
committed by Matt Corallo
parent 676ad04958
commit b790f82849
4 changed files with 35 additions and 12 deletions

View File

@@ -37001,8 +37001,7 @@ window.axolotl.protocol = function() {
if (open_session !== undefined)
closeSession(open_session); // To be returned and saved later
} else {
// ...otherwise create an error that the UI will pick up and ask the user if they want to re-negotiate
throw new textsecure.IncomingIdentityKeyError(encodedNumber, getString(message.encode()));
throw new Error('Unknown identity key');
}
}
return initSession(false, preKeyPair, signedPreKeyPair, encodedNumber, toArrayBuffer(message.identityKey), toArrayBuffer(message.baseKey), undefined)