commit eb1d7675c4ea40f5f9800cd58c4983f6f9643a40
parent ecaf088c69f9feccaeb6240ffa6729baf21768a6
Author: Jan Dankert <develop@jandankert.de>
Date: Thu, 29 Aug 2019 23:11:13 +0200
Log all UI-Exceptions to Log, because in Production-Mode they will not get displayed.
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/index.php b/index.php
@@ -64,7 +64,8 @@ if (!headers_sent())
<p>Something went terribly wrong.</p>
- <?php if (defined('DEVELOPMENT') && DEVELOPMENT ) { ?>
+ <?php // Display exceptions only in development mode, because the may contain sensitive internal information like passwords.
+ if (defined('DEVELOPMENT') && DEVELOPMENT ) { ?>
<pre><?php echo $e->__toString(); ?></pre>
<?php } ?>
</main>
diff --git a/modules/cms-ui/UI.class.php b/modules/cms-ui/UI.class.php
@@ -47,11 +47,13 @@ class UI
} catch (BadMethodCallException $e) {
// Action-Method does not exist.
+ Logger::warn( $e->__toString() );
Http::noContent();
} catch (ObjectNotFoundException $e) {
- Logger::warn("Object not found: " . $e->__toString()); // Nur Debug, da dies bei gelöschten Objekten vorkommen kann.
+ Logger::debug("Object not found: " . $e->__toString()); // Nur Debug, da dies bei gelöschten Objekten vorkommen kann.
Http::noContent();
} catch (OpenRatException $e) {
+ Logger::warn( $e->__toString() );
throw new LogicException(lang($e->key),0, $e);
} catch (SecurityException $e) {
Logger::info($e->getMessage());
@@ -60,6 +62,7 @@ class UI
// this is not good at all, because the user may have signed off.
//Http::notAuthorized("You are not allowed to execute this action.");
} catch (Exception $e) {
+ Logger::warn( $e->__toString() );
throw new LogicException("Internal CMS error: ".$e->__toString(),0, $e);
}
}