Browse Source
			
			
			Merge pull request #55183 from nextcloud/bugfix/noid/translate-exception-to-sabre-exception
			
				fix(trashbin): Translate Nextcloud exception to Sabre exception
			
			
				pull/55180/head
			
			
		 
		
			
				
					
						 Joas Schilling
					
					1 month ago
						Joas Schilling
					
					1 month ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: B5690EEEBB952194
				  	
				  
				
			
		
		
		
	
		
			
				 1 changed files with 
7 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					apps/files_trashbin/lib/Sabre/TrashFile.php
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -9,10 +9,16 @@ declare(strict_types=1); | 
			
		
	
		
			
				
					|  |  |  | namespace OCA\Files_Trashbin\Sabre; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | use OCA\Files_Trashbin\Trashbin; | 
			
		
	
		
			
				
					|  |  |  | use OCP\Files\ForbiddenException; | 
			
		
	
		
			
				
					|  |  |  | use Sabre\DAV\Exception\Forbidden; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | class TrashFile extends AbstractTrashFile { | 
			
		
	
		
			
				
					|  |  |  | 	public function get() { | 
			
		
	
		
			
				
					|  |  |  | 		return $this->data->getStorage()->fopen(Trashbin::getTrashFilename($this->data->getInternalPath(), $this->getDeletionTime()), 'rb'); | 
			
		
	
		
			
				
					|  |  |  | 		try { | 
			
		
	
		
			
				
					|  |  |  | 			return $this->data->getStorage()->fopen(Trashbin::getTrashFilename($this->data->getInternalPath(), $this->getDeletionTime()), 'rb'); | 
			
		
	
		
			
				
					|  |  |  | 		} catch (ForbiddenException) { | 
			
		
	
		
			
				
					|  |  |  | 			throw new Forbidden(); | 
			
		
	
		
			
				
					|  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 	public function getName(): string { | 
			
		
	
	
		
			
				
					|  |  | 
 |