/** * Uncaught exception handler. Triggers the `log` and `error` events. * * Logs all except {@link \H\X} because it's intended for the user and can have large payloads. * * PHP 5-7 compatible. * * @param \Exception|\Throwable $thrown */ private static function phpExceptionHandler($thrown) { !$thrown instanceof X and E::notify('log', $thrown, $thrown->getCode()); E::notify('error', $thrown); }