+ /**
+ * @param CRM_Core_Exception Exception $exception
+ * @param mixed $request
+ * Reserved for future use.
+ */
+ public static function unhandledException($exception, $request = NULL) {
+ self::singleton()
+ ->invoke(2, $exception, $request, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_unhandled_exception');
+ // == 4.4 ==
+ //$event = new stdClass();
+ //$event->exception = $exception;
+ //CRM_Core_LegacyErrorHandler::handleException($event);
+
+ // == 4.5+ ==
+ $event = new \Civi\Core\Event\UnhandledExceptionEvent($exception, self::$_nullObject);
+ \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("hook_civicrm_unhandled_exception", $event);
+ }