CRM-15683 Tim's proposed changes
[civicrm-core.git] / CRM / Utils / Hook.php
index f7f0c012228f74e4482f456042d9d3c743222dcc..6787614073f887879f0b4843d61a73f67443c6e7 100644 (file)
@@ -1461,7 +1461,10 @@ abstract class CRM_Utils_Hook {
    * @param CRM_Core_Exception Exception $exception
    */
   static function unhandledException($exception) {
-    self::singleton()->invoke(1, $exception, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_unhandled_exception');
+    self::singleton()->invoke(1, $exception, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,'civicrm_unhandled_exception');
+    // == 4.5+ ==
+   $event = new \Civi\Core\Event\UnhandledExceptionEvent(self::$_nullObject, $exception);
+    \Civi\Core\Container::singleton()->get('dispatcher')->dispatch("unhandled_exception", $event);
   }
 
   /**