Commit | Line | Data |
---|---|---|
665b4982 EM |
1 | <?php |
2 | ||
1cd3ffa9 EM |
3 | /** |
4 | * Class CRM_Core_LegacyErrorHandler | |
5 | */ | |
665b4982 | 6 | class CRM_Core_LegacyErrorHandler { |
518fa0ee | 7 | |
4caeca04 TO |
8 | /** |
9 | * @param \Civi\Core\Event\UnhandledExceptionEvent $event | |
10 | * @throws Exception | |
11 | */ | |
7c550ca0 | 12 | public static function handleException($event) { |
4caeca04 | 13 | $e = $event->exception; |
665b4982 EM |
14 | if ($e instanceof CRM_Core_Exception) { |
15 | $params = $e->getErrorData(); | |
16 | $message = $e->getMessage(); | |
17 | $session = CRM_Core_Session::singleton(); | |
18 | $session->setStatus( | |
8c48f220 CW |
19 | htmlspecialchars($message), |
20 | htmlspecialchars($params['message_title'] ?? ts('Error')), | |
21 | $params['message_type'] ?? 'error' | |
665b4982 | 22 | ); |
665b4982 EM |
23 | } |
24 | } | |
4caeca04 | 25 | |
665b4982 | 26 | } |