mirror of
https://github.com/nextcloud/server.git
synced 2026-03-12 05:33:11 -04:00
fix(trashbin): Translate Nextcloud exception to Sabre exception
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
b56ceefcee
commit
722d4b452f
1 changed files with 7 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue