[Pkg-owncloud-commits] [owncloud] 06/10: Throw nicer error message instead 500

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


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

taffit pushed a commit to annotated tag v6.0.9beta
in repository owncloud.

commit a9838b37f1f72ff85f5e256439beeb948dbe8eb9
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 d688ceb..da20530 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