Throw nicer error message instead 500

This commit is contained in:
Lukas Reschke 2015-06-17 15:36:54 +02:00
parent 2d648ed0eb
commit 414896d8a0
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ $pathId = $linkedItem['file_source'];
$path = $view->getPath($pathId);
if($path === null) {
throw new \OCP\Files\NotFoundException();
\OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND);
\OC_Log::write('core-preview', 'Could not resolve file for shared item', OC_Log::WARN);
exit;
}
$pathInfo = $view->getFileInfo($path);