Handle attachment upload errors
Adds a new kind of replayable error that handles retry of pre-encryption failures, e.g., attachment upload. Fixes #485 // FREEBIE
This commit is contained in:
parent
910e37649a
commit
7e82d1295c
5 changed files with 64 additions and 17 deletions
|
@ -9,6 +9,7 @@
|
|||
ENCRYPT_MESSAGE: 1,
|
||||
INIT_SESSION: 2,
|
||||
TRANSMIT_MESSAGE: 3,
|
||||
REBUILD_MESSAGE: 4,
|
||||
};
|
||||
window.textsecure = window.textsecure || {};
|
||||
window.textsecure.replay = {
|
||||
|
@ -87,10 +88,25 @@
|
|||
SendMessageNetworkError.prototype = new ReplayableError();
|
||||
SendMessageNetworkError.prototype.constructor = SendMessageNetworkError;
|
||||
|
||||
function MessageError(message, httpError) {
|
||||
ReplayableError.call(this, {
|
||||
functionCode : Type.REBUILD_MESSAGE,
|
||||
args : [message]
|
||||
});
|
||||
this.name = 'MessageError';
|
||||
this.code = httpError.code;
|
||||
this.message = httpError.message;
|
||||
this.stack = httpError.stack;
|
||||
}
|
||||
MessageError.prototype = new ReplayableError();
|
||||
MessageError.prototype.constructor = MessageError;
|
||||
|
||||
|
||||
window.textsecure.SendMessageNetworkError = SendMessageNetworkError;
|
||||
window.textsecure.IncomingIdentityKeyError = IncomingIdentityKeyError;
|
||||
window.textsecure.OutgoingIdentityKeyError = OutgoingIdentityKeyError;
|
||||
window.textsecure.ReplayableError = ReplayableError;
|
||||
window.textsecure.OutgoingMessageError = OutgoingMessageError;
|
||||
window.textsecure.MessageError = MessageError;
|
||||
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue