If the location is not routable, log the error, notify the user and redirect to the...
authorGunnar Wrobel <p@rdus.de>
Fri, 5 Jun 2009 21:55:51 +0000 (23:55 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 5 Jun 2009 21:55:51 +0000 (23:55 +0200)
koward/www/htdocs/koward/koward.php

index c327063..556a2ef 100644 (file)
@@ -16,7 +16,15 @@ Horde_Autoloader::addClassPattern('/^Koward_/', 'Koward/');
 try {
     Koward::dispatch(__FILE__);
 } catch (Exception $e) {
-    // @TODO Make nicer
-    echo '<h1>' . $e->getMessage() . '</h1>';
-    echo '<pre>'; var_dump($e); echo '</pre>';
+    global $notification, $registry;
+
+    Horde::logMessage($e->getMessage(), __FILE__, __LINE__, PEAR_LOG_DEBUG);
+
+    if (isset($notification)) {
+        $notification->push($e->getMessage(), 'horde.error');
+    }
+
+    if (isset($registry)) {
+        header('Location: ' . $registry->get('webroot', 'koward'));
+    }
 }