Don't surface invalid attachment urls to the user
Log them, but don't put display them in user-facing error ui. // FREEBIE
This commit is contained in:
		
					parent
					
						
							
								7b1268e5f7
							
						
					
				
			
			
				commit
				
					
						ea980b4385
					
				
			
		
					 2 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -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",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue