diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2012-05-16 15:00:23 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2012-05-16 15:00:23 +0200 |
commit | 76e499e8a1760d1c519a228e13dfdb69fd4c38f7 (patch) | |
tree | dd4581cf023b9aa293d562366615aaefa7504cb3 | |
parent | 8193151b5ae9e78818926b646a7e8181de97f41c (diff) |
Also accept PHP exceptions as argument to rcube::raise_error()
-rw-r--r-- | program/include/rcube.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/program/include/rcube.php b/program/include/rcube.php index 694f28820..e9add8d5a 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -1050,6 +1050,18 @@ class rcube */ public static function raise_error($arg = array(), $log = false, $terminate = false) { + // handle PHP exceptions + if (is_object($arg) && is_a($arg, 'Exception')) { + $err = array( + 'type' => 'php', + 'code' => $arg->getCode(), + 'line' => $arg->getLine(), + 'file' => $arg->getFile(), + 'message' => $arg->getMessage(), + ); + $arg = $err; + } + // installer if (class_exists('rcube_install', false)) { $rci = rcube_install::get_instance(); |