mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
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:
@@ -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;
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user