Permalink
Browse files

Merge branch '3.2' into 3.3

  • Loading branch information...
nsams committed Dec 28, 2015
2 parents dfe7b77 + f2d2400 commit b218299d1726acb62befb0901b46673df40dee2e
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 b218299

Please sign in to comment.