summaryrefslogtreecommitdiffstats
path: root/public.php
diff options
context:
space:
mode:
Diffstat (limited to 'public.php')
-rw-r--r--public.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/public.php b/public.php
index 65257f1a46e..c4d96c06496 100644
--- a/public.php
+++ b/public.php
@@ -49,7 +49,7 @@ try {
$pathInfo = trim($pathInfo, '/');
list($service) = explode('/', $pathInfo);
}
- $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service));
+ $file = OCP\Config::getAppValue('core', 'public_' . strip_tags($service));
if (is_null($file)) {
header('HTTP/1.0 404 Not Found');
exit;
@@ -73,14 +73,18 @@ try {
require_once OC_App::getAppPath($app) . '/' . $parts[1];
-} catch (\OC\ServiceUnavailableException $ex) {
+} catch (Exception $ex) {
+ if ($ex instanceof \OC\ServiceUnavailableException) {
+ OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ } else {
+ OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
+ }
//show the user a detailed error page
- OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
- \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
+ \OC::$server->getLogger()->logException($ex, ['app' => 'public']);
OC_Template::printExceptionErrorPage($ex);
-} catch (Exception $ex) {
+} catch (Error $ex) {
//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
- \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
+ \OC::$server->getLogger()->logException($ex, ['app' => 'public']);
OC_Template::printExceptionErrorPage($ex);
}