From 0f7f5bdb34281b352d32aae32a3c3bb8886affb4 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 17 Jun 2015 15:36:54 +0200 Subject: Throw nicer error message instead 500 --- apps/files_sharing/ajax/publicpreview.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 833bd1b4333..bf30f7fa179 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -48,7 +48,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); -- cgit v1.2.3