diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 05707f29..eea7ce22 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38514,7 +38514,7 @@ OutgoingMessage.prototype = { } }, registerError: function(number, reason, error) { - if (!error || error.name === 'HTTPError') { + if (!error || error.name === 'HTTPError' && error.code !== 404) { error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error); } @@ -38570,7 +38570,7 @@ OutgoingMessage.prototype = { transmitMessage: function(number, jsonData, timestamp) { return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) { - if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) { + if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410 && e.code !== 404)) { // 409 and 410 should bubble and be handled by doSendMessage // all other network errors can be retried later. throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp); diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index 6db428c5..316eb299 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -23,7 +23,7 @@ OutgoingMessage.prototype = { } }, registerError: function(number, reason, error) { - if (!error || error.name === 'HTTPError') { + if (!error || error.name === 'HTTPError' && error.code !== 404) { error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error); } @@ -79,7 +79,7 @@ OutgoingMessage.prototype = { transmitMessage: function(number, jsonData, timestamp) { return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) { - if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) { + if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410 && e.code !== 404)) { // 409 and 410 should bubble and be handled by doSendMessage // all other network errors can be retried later. throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);