]> source.dussan.org Git - nextcloud-server.git/commitdiff
Throw nicer error message instead 500
authorLukas Reschke <lukas@owncloud.com>
Wed, 17 Jun 2015 13:36:54 +0000 (15:36 +0200)
committerLukas Reschke <lukas@owncloud.com>
Wed, 17 Jun 2015 13:42:00 +0000 (15:42 +0200)
apps/files_sharing/ajax/publicpreview.php

index d688ceb841045d2e8434655c1fb8f1f36bcd925c..da2053067d8ed282b2f13ff3fbbc2527af352853 100644 (file)
@@ -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);