[Pkg-owncloud-commits] [owncloud] 17/205: Throw nicer error message instead 500
David Prévot
taffit at moszumanska.debian.org
Thu Jul 2 17:36:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 414896d8a095d93ebd4d8cd76981392c7b19f9a2
Author: Lukas Reschke <lukas at owncloud.com>
Date: Wed Jun 17 15:36:54 2015 +0200
Throw nicer error message instead 500
---
apps/files_sharing/ajax/publicpreview.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index fff1a60..0734c8c 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);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list