summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-06-17 15:36:54 +0200
committerLukas Reschke <lukas@owncloud.com>2015-06-17 15:39:13 +0200
commit414896d8a095d93ebd4d8cd76981392c7b19f9a2 (patch)
tree9cc5084e814e0f8167ce6d3df3ec35a27790ef43 /apps/files_sharing/ajax
parent2d648ed0eb301ed35db568071325bdc7e0428eb9 (diff)
downloadnextcloud-server-414896d8a095d93ebd4d8cd76981392c7b19f9a2.tar.gz
nextcloud-server-414896d8a095d93ebd4d8cd76981392c7b19f9a2.zip
Throw nicer error message instead 500
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r--apps/files_sharing/ajax/publicpreview.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index fff1a60b24e..0734c8c1159 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -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);