[Pkg-owncloud-commits] [owncloud] 42/62: Throw nicer error message instead 500

David Prévot taffit at moszumanska.debian.org
Tue Jun 23 23:39:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.5beta
in repository owncloud.

commit 0f7f5bdb34281b352d32aae32a3c3bb8886affb4
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 833bd1b..bf30f7f 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);

-- 
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