static function getName(\Throwable $exception): string
    {
        $name = null;

        if ($exception instanceof \ErrorException) {
            $name = Error::getName($exception->getSeverity());
        }

        if ($name === null) {
            $name = get_class($exception);
        }

        if (($code = $exception->getCode()) !== 0) {
            $name .= " ({$code})";
        }

        return $name;
    }