private function makeExceptionResponse(Request $request): \Generator
    {
        $status = Status::INTERNAL_SERVER_ERROR;

        try {
            return yield $this->errorHandler->handleError($status, null, $request);
        } catch (\Throwable $exception) {
            // If the error handler throws, fallback to returning the default HTML error page.
            $this->logger->error($exception);

            // The default error handler will never throw, otherwise there's a bug
            return yield self::$defaultErrorHandler->handleError($status, null, $request);
        }
    }