transform exception during file read to sabre exceptions
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
7a3ce073da
commit
e6a7ddc1c6
|
@ -332,7 +332,11 @@ class File extends Node implements IFile {
|
||||||
// do a if the file did not exist
|
// do a if the file did not exist
|
||||||
throw new NotFound();
|
throw new NotFound();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
$res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
|
$res = $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->convertToSabreException($e);
|
||||||
|
}
|
||||||
if ($res === false) {
|
if ($res === false) {
|
||||||
throw new ServiceUnavailable("Could not open file");
|
throw new ServiceUnavailable("Could not open file");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue