Merge pull request #9148 from nextcloud/dav-read-exception

transform exception during file read to sabre exceptions
pull/9134/head
Roeland Jago Douma 2018-04-11 16:03:12 +07:00 committed by GitHub
commit fed9140abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

@ -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");
}