Permalink
Browse files

Merge branch '3.1' into 3.2

  • Loading branch information...
nsams committed Dec 28, 2015
2 parents c701928 + 8c410ee commit f2d24005042987c239ffbc2020e69a88cd15989d
Showing with 14 additions and 5 deletions.
  1. +14 −5 Kwf/Exception/Abstract.php
View
@@ -69,11 +69,20 @@ public function render($ignoreCli = false)
try {
echo $view->render($template);
} catch (Exception $e) {
- echo '<pre>';
- echo $this->__toString();
- echo "\n\n\nError happened while handling exception:";
- echo $e->__toString();
- echo '</pre>';
+ if (Kwf_Exception::isDebug()) {
+ echo '<pre>';
+ echo $this->getException()->__toString();
+ echo "\n\n\nError happened while handling exception:";
+ echo $e->__toString();
+ echo '</pre>';
+ } else {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ header('Content-Type: text/html; charset=utf-8');
+ }
+ echo '<h1>Error</h1>';
+ echo '<p>An Error ocurred. Please try again later.</p>';
+ }
}
}

0 comments on commit f2d2400

Please sign in to comment.