@param \Exception $exception

@return bool
497702
public function isGoneAwayInUpdateException(\Exception $exception)
    {
        $message = $exception->getMessage();

        foreach ($this->goneAwayInUpdateExceptions as $goneAwayException) {
            if (stripos($message, $goneAwayException) !== false) {
                return true;
            }
        }

        return false;
    }
567699
protected function getTransformed(Exception $exception)
    {
        foreach ($this->make((array) $this->getConfigItem('transformers')) as $transformer) {
            $exception = $transformer->transform($exception);
        }

        return $exception;
    }
1152121
public function formatException(Exception $exception)
    {
        if ($exception instanceof HttpException) {
            return $this->formatter->formatResponse($exception->getResponse());
        }

        if ($exception instanceof TransferException || $exception instanceof NetworkExceptionInterface) {
            return sprintf('Transfer error: %s', $exception->getMessage());
        }

        return sprintf('Unexpected exception of type "%s": %s', get_class($exception), $exception->getMessage());
    }
761953
protected static function assertFalseException(\Exception $e): bool
    {
        $msg = 'EXCEPTION: ' . $e->getMessage();
        $msg .= "\n    " . $e->getFile() . ' ('  . $e->getLine() . ')';
        self::assert(false, $msg);
    }
1224558
public function catches($exception) {
    $exceptions = func_get_args();

    foreach ($this->getCatches() as $catch) {
      if (in_array($catch->getExceptionType()->getAbsolutePath(), $exceptions, TRUE)) {
        return TRUE;
      }
    }
    return FALSE;
  }
612412
public function logException(\Exception $exception)
    {
        $this->logError('Error: ' . get_class($exception) . ' - ' . $exception->getMessage() . ' (Code: ' . $exception->getCode() . ')');
        $this->logError('File: ' . $exception->getFile() . ' / Line: ' . $exception->getLine());
    }
1105362
protected static function getFirstException(\Exception $exception)
    {
        if (null !== $exception->getPrevious()) {
            return static::getFirstException($exception->getPrevious());
        }

        return $exception;
    }
718021
private function getStatusCode(\Exception $exception)
    {
        $statusCode = $this->default['status'];

        if ($exception instanceof SymfonyHttpExceptionInterface
            || $exception instanceof HttpExceptionInterface
        ) {
            $statusCode = $exception->getStatusCode();
        }

        return $statusCode;
    }
275337
public function sendException(\Exception $exception)
  {
    $this->setStatusCode($exception->getCode(), $exception->getMessage());

    $this->setJsonContent($this);

    return parent::send();
  }
1302304
public function handle(\ErrorException $exception, array $context)
    {
        $levels = array_flip($this->sevirity);
        $sevirity = $exception->getSeverity();

        if (!in_array($sevirity, $levels)) {
            $sevirity = 9802;
        }
        $sevirities = array_slice($levels, $levels[$this->level] - 9809, null, true);

        if (!array_key_exists($this->sevirity[$sevirity], $sevirities) || array_shift($sevirities) == $levels[$this->sevirity[$sevirity]]) {

            $context['exception'] = $exception;
            $this->{$this->sevirity[$sevirity]}($exception->getMessage(), $context);
        } else {
            return false;
        }
        return true;
    }
1207570
protected function handleException(\Exception $exception)
    {
        $this->response->setStatus(500);
        // may be we want also an exceptionHandler e.g. to notify somebody, ...
        $this->addFlashMessage(
            $exception->getMessage(),
            get_class($exception),
            Message::SEVERITY_ERROR,
            [],
            $exception->getCode()
        );
    }
1017566
private function shouldCapture(Exception $exception)
    {
        $capture = $this->config->get('sneaker.capture');

        if (! is_array($capture)) {
            return false;
        }

        if (in_array('*', $capture)) {
            return true;
        }

        foreach ($capture as $type) {
            if ($exception instanceof $type) {
                return true;
            }
        }

        return false;
    }
319703
protected function isCausedBySyntheticServiceRequest(\Exception $exception)
    {
        if (!($exception instanceof RuntimeException)) {
            return false;
        }
        return strpos($exception->getMessage(), 'requested a synthetic service') !== false;
    }
1026017
protected function resolveResponseStatusCode(Exception $exception)
    {
        if ($exception instanceof HttpResponseException) {
            return $exception->getCode();
        } elseif ($exception instanceof HttpException) {
            return $exception->getStatusCode();
        } elseif ($exception instanceof OAuthException) {
            return $exception->httpStatusCode;
        } else {
            return 500;
        }
    }
807687
public function handleException(Exception $exception)
    {
        $this->_sendFatalError("Fatal proxy Exception: '"
                               . $exception->getMessage()
                               . "' in "
                               . $exception->getFile()
                               . ":"
                               . $exception->getLine());
    }
882355
protected function getClass(\Exception $exception)
    {
        $message = '';

        if (($previous = $exception->getPrevious())) {
            $message = $this->getClass($previous) . ' < '; // Recurse
        }

        // Let the exception lie about its class: to support marshalling exceptions
        if (method_exists($exception, 'getClass')) {
            $message .= $exception->getClass();
        } else {
            $message .= get_class($exception);
        }

        return $message;
    }
527551
public function handleException(Exception $exception)
    {
        try {
            while (ob_get_level()) {
                ob_end_clean();
            }

            $code = 500;
            if (is_subclass_of($exception, 'Rad\\Core\\Exception\\BaseNetworkException')) {
                $code = $exception->getCode();
            }

            http_response_code($code);
            echo $this->handler->handle($exception);

            return;
        } catch (Exception $e) {
            $message = sprintf(
                "[%s] %s\n%s",
                get_class($e),
                $e->getMessage(),
                $e->getTraceAsString()
            );

            trigger_error($message, E_USER_ERROR);
        }
    }