@@ -37,48 +37,48 @@ |
||
| 37 | 37 | |
| 38 | 38 | try { |
| 39 | 39 | |
| 40 | - require_once __DIR__ . '/lib/base.php'; |
|
| 40 | + require_once __DIR__ . '/lib/base.php'; |
|
| 41 | 41 | |
| 42 | - OC::handleRequest(); |
|
| 42 | + OC::handleRequest(); |
|
| 43 | 43 | |
| 44 | 44 | } catch(\OC\ServiceUnavailableException $ex) { |
| 45 | - \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 45 | + \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 46 | 46 | |
| 47 | - //show the user a detailed error page |
|
| 48 | - OC_Template::printExceptionErrorPage($ex, 503); |
|
| 47 | + //show the user a detailed error page |
|
| 48 | + OC_Template::printExceptionErrorPage($ex, 503); |
|
| 49 | 49 | } catch (\OC\HintException $ex) { |
| 50 | - try { |
|
| 51 | - OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503); |
|
| 52 | - } catch (Exception $ex2) { |
|
| 53 | - try { |
|
| 54 | - \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 55 | - \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); |
|
| 56 | - } catch (Throwable $e) { |
|
| 57 | - // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here |
|
| 58 | - } |
|
| 50 | + try { |
|
| 51 | + OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503); |
|
| 52 | + } catch (Exception $ex2) { |
|
| 53 | + try { |
|
| 54 | + \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 55 | + \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); |
|
| 56 | + } catch (Throwable $e) { |
|
| 57 | + // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - //show the user a detailed error page |
|
| 61 | - OC_Template::printExceptionErrorPage($ex, 500); |
|
| 62 | - } |
|
| 60 | + //show the user a detailed error page |
|
| 61 | + OC_Template::printExceptionErrorPage($ex, 500); |
|
| 62 | + } |
|
| 63 | 63 | } catch (\OC\User\LoginException $ex) { |
| 64 | - OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403); |
|
| 64 | + OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403); |
|
| 65 | 65 | } catch (Exception $ex) { |
| 66 | - \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 66 | + \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 67 | 67 | |
| 68 | - //show the user a detailed error page |
|
| 69 | - OC_Template::printExceptionErrorPage($ex, 500); |
|
| 68 | + //show the user a detailed error page |
|
| 69 | + OC_Template::printExceptionErrorPage($ex, 500); |
|
| 70 | 70 | } catch (Error $ex) { |
| 71 | - try { |
|
| 72 | - \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 73 | - } catch (Error $e) { |
|
| 74 | - http_response_code(500); |
|
| 75 | - header('Content-Type: text/plain; charset=utf-8'); |
|
| 76 | - print("Internal Server Error\n\n"); |
|
| 77 | - print("The server encountered an internal error and was unable to complete your request.\n"); |
|
| 78 | - print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n"); |
|
| 79 | - print("More details can be found in the webserver log.\n"); |
|
| 71 | + try { |
|
| 72 | + \OC::$server->getLogger()->logException($ex, array('app' => 'index')); |
|
| 73 | + } catch (Error $e) { |
|
| 74 | + http_response_code(500); |
|
| 75 | + header('Content-Type: text/plain; charset=utf-8'); |
|
| 76 | + print("Internal Server Error\n\n"); |
|
| 77 | + print("The server encountered an internal error and was unable to complete your request.\n"); |
|
| 78 | + print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n"); |
|
| 79 | + print("More details can be found in the webserver log.\n"); |
|
| 80 | 80 | |
| 81 | - throw $ex; |
|
| 82 | - } |
|
| 83 | - OC_Template::printExceptionErrorPage($ex, 500); |
|
| 81 | + throw $ex; |
|
| 82 | + } |
|
| 83 | + OC_Template::printExceptionErrorPage($ex, 500); |
|
| 84 | 84 | } |