summaryrefslogtreecommitdiff
path: root/public_html/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'public_html/index.php')
-rw-r--r--public_html/index.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/public_html/index.php b/public_html/index.php
index 66b3d0c..b076c43 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -8,7 +8,7 @@
* @version 0.2.5
* @author Thomas Bruederli <bruederli@kolabsys.com>
*
- * Copyright (C) 2013, Kolab Systems AG <contact@kolabsys.com>
+ * Copyright (C) 2013-2014, Kolab Systems AG <contact@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -167,6 +167,19 @@ if (getenv('DAVBROWSER')) {
$server->addPlugin(new \Sabre\DAV\Browser\Plugin());
}
+// log exceptions in iRony error log
+$server->subscribeEvent('exception', function($e){
+ if (!($e instanceof \Sabre\DAV\Exception) || $e->getHTTPCode() == 500) {
+ rcube::raise_error(array(
+ 'code' => 500,
+ 'type' => 'php',
+ 'file' => $e->getFile(),
+ 'line' => $e->getLine(),
+ 'message' => $e->getMessage() . " (error 500)\n" . $e->getTraceAsString(),
+ ), true, false);
+ }
+});
+
// finally, process the request
$server->exec();