From 6a6fc742dc736875a9d0a2be6891ba0fc635f1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 20 Apr 2016 18:01:47 +0200 Subject: Catch class Error on all root entrypoints --- remote.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'remote.php') diff --git a/remote.php b/remote.php index 814286860af..991ca0d2302 100644 --- a/remote.php +++ b/remote.php @@ -40,9 +40,9 @@ class RemoteException extends Exception { } /** - * @param Exception $e + * @param Exception | Error $e */ -function handleException(Exception $e) { +function handleException($e) { $request = \OC::$server->getRequest(); // in case the request content type is text/xml - we assume it's a WebDAV request $isXmlContentType = strpos($request->getHeader('Content-Type'), 'text/xml'); @@ -77,7 +77,7 @@ function handleException(Exception $e) { OC_Response::setStatus($e->getCode()); OC_Template::printErrorPage($e->getMessage()); } else { - \OCP\Util::writeLog('remote', $e->getMessage(), \OCP\Util::FATAL); + \OC::$server->getLogger()->logException($e, ['app' => 'remote']); OC_Response::setStatus($statusCode); OC_Template::printExceptionErrorPage($e); } @@ -165,4 +165,6 @@ try { } catch (Exception $ex) { handleException($ex); +} catch (Error $e) { + handleException($ex); } -- cgit v1.2.3