public function handleException($exception, $request, $response)
    {
        $renderer = $this->getRenderer($exception, $request);
        try {
            $res = $renderer->render();
            $this->logException($request, $exception);

            return $res;
        } catch (Throwable $exception) {
            $this->logException($request, $exception);
            $response = $this->handleInternalError($response);
        } catch (Exception $exception) {
            $this->logException($request, $exception);
            $response = $this->handleInternalError($response);
        }

        return $response;
    }