Merge pull request #15410 from herbdool/cloud-21
[civicrm-core.git] / CRM / Core / LegacyErrorHandler.php
1 <?php
2
3 /**
4 * Class CRM_Core_LegacyErrorHandler
5 */
6 class CRM_Core_LegacyErrorHandler {
7
8 /**
9 * @param \Civi\Core\Event\UnhandledExceptionEvent $event
10 * @throws Exception
11 */
12 public static function handleException($event) {
13 $e = $event->exception;
14 if ($e instanceof CRM_Core_Exception) {
15 $params = $e->getErrorData();
16 $message = $e->getMessage();
17 $session = CRM_Core_Session::singleton();
18 $session->setStatus(
19 $message,
20 CRM_Utils_Array::value('message_title', $params),
21 CRM_Utils_Array::value('message_type', $params, 'error')
22 );
23 }
24 }
25
26 }