/** * Raise an error from an Exception * @param Exception * @param int php error type constant * @return PLUGError */ static function raise_exception(Exception $Ex, $type) { if (error_reporting() === 0) { // suppressed with `@' operator return; } PLUG::clear_error_handlers(); $code = $Ex->getCode() or $code = PLUG_EXCEPTION_STD; $Err = new PLUGError($code, $type, $Ex->getMessage(), $Ex->getFile(), $Ex->getLine(), $Ex->getTrace()); $Err->raise(); PLUG::set_error_handlers(); return $Err; }