From e6a7ddc1c6e5104c65f259ebb6e9d21e5d476621 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 11 Apr 2018 14:45:35 +0200 Subject: [PATCH] transform exception during file read to sabre exceptions Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/File.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 6a467e9eff..e577510b69 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -332,7 +332,11 @@ class File extends Node implements IFile { // do a if the file did not exist throw new NotFound(); } - $res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb'); + try { + $res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb'); + } catch (\Exception $e) { + $this->convertToSabreException($e); + } if ($res === false) { throw new ServiceUnavailable("Could not open file"); }