Don't surface invalid attachment urls to the user

Log them, but don't put display them in user-facing error ui.

// FREEBIE
pull/749/head
lilia 10 years ago
parent 7b1268e5f7
commit ea980b4385

@ -36498,7 +36498,8 @@ var TextSecureServer = (function() {
}).then(function(response) {
var match = response.location.match(this.attachment_id_regex);
if (!match) {
throw new Error('Received invalid attachment url: ' + response.location);
console.log('Invalid attachment url for incoming message', response.location);
throw new Error('Received invalid attachment url');
}
return ajax(response.location, {
type : "GET",
@ -36516,7 +36517,8 @@ var TextSecureServer = (function() {
// (workaround for ids too large for Javascript numbers)
var match = response.location.match(this.attachment_id_regex);
if (!match) {
throw new Error('Received invalid attachment url: ' + response.location);
console.log('Invalid attachment url for outgoing message', response.location);
throw new Error('Received invalid attachment url');
}
return ajax(response.location, {
type : "PUT",

@ -315,7 +315,8 @@ var TextSecureServer = (function() {
}).then(function(response) {
var match = response.location.match(this.attachment_id_regex);
if (!match) {
throw new Error('Received invalid attachment url: ' + response.location);
console.log('Invalid attachment url for incoming message', response.location);
throw new Error('Received invalid attachment url');
}
return ajax(response.location, {
type : "GET",
@ -333,7 +334,8 @@ var TextSecureServer = (function() {
// (workaround for ids too large for Javascript numbers)
var match = response.location.match(this.attachment_id_regex);
if (!match) {
throw new Error('Received invalid attachment url: ' + response.location);
console.log('Invalid attachment url for outgoing message', response.location);
throw new Error('Received invalid attachment url');
}
return ajax(response.location, {
type : "PUT",

Loading…
Cancel
Save