Return the response body of the exception

@return null|RequestException
199200
public function getRequestException()
    {
        if (!is_null($this->requestException)) {
            return $this->requestException;
        }

        $search = function (\Exception $exception = null) use (&$search) {
            $previous = $exception->getPrevious();

            if (is_null($previous)) {
                return null;
            }

            if ($previous instanceof RequestException) {
                return $this->requestException = $previous;
            }

            return $search($previous);
        };

        return $search($this);
    }
1149650
public function getResponse( RequestInterface $request, PhpException $exception ) {
		$response = $this->toResponse( $exception );

		if ( $response !== false ) {
			return $response;
		}

		if ( ! $this->debug ) {
			return Response::error( 500 );
		}

		return $this->toDebugResponse( $request, $exception );
	}
764217
protected function parseDataFromResponse()
    {
        $content = $this->rawResponse->body;
        if (empty($content)) {
            throw new OssException("body is null");
        }
        $xml = simplexml_load_string($content);
        return $xml;
    }
559479
public function getResponseData()
    {
        $data = null;

        if ($body = $this->getResponseBody()) {
            if (($decoded = json_decode($body, true))) {
                $data = $decoded;
            }
        }

        return $data;
    }
781296
protected function getEmptyBody()
    {
        $body = $this->response->getBody();
        if (!$body->isWritable()) {
            throw new \RuntimeException('response body is not writeble');
        }
        if ($body->getSize() !== 0) {
            throw new \RuntimeException('response body is not empty');
        }

        return $body;
    }
1194113
protected function toDebugResponse( RequestInterface $request, PhpException $exception ) {
		if ( $request->isAjax() ) {
			return Response::json( [
				'message' => $exception->getMessage(),
				'exception' => get_class( $exception ),
				'file' => $exception->getFile(),
				'line' => $exception->getLine(),
				'trace' => array_map( function ( $trace ) {
					return Arr::except( $trace, ['args'] );
				}, $exception->getTrace() ),
			] )->withStatus( 500 );
		}

		if ( $this->whoops !== null ) {
			return $this->toPrettyErrorResponse( $exception );
		}

		throw $exception;
	}
180947
public InputStream getResponseBodyAsStream() throws HttpException {
    try {
      HttpEntity ent = getResponseEntity();

      if (ent == null) {
        return null;
      }

      return ent.getContent();
    } catch (Throwable t) {
      throw new HttpException(t.getLocalizedMessage(), t);
    }
  }
86129
public function getVerboseResponse() 
    {
        $this->execute();
        
        if ($this->error) {
            return $this->error;
        }
        
        $contentType = $this->getContentType();
        
        $body = ($this->def['dataType'] == 'array' || strpos($contentType, 'json') !== false) ? static::data2json($this->responseText) : $this->responseText;
        
        return [
            'status'    => $this->status,
            'body'      => $body, 
            'info'      => $this->responseInfo,
            'header'    => $this->responseHeaders,
            'request_header'    => $this->getRequestHeaders(),
            'content_type'      => $contentType
        ];
    }
136845
public function getResponse()
    {
        if ($this->response === null and $this->isExecuted()) {
            $this->response = Response::forge($this);
        }

        return $this->response;
    }
137474
public function getResponse()
    {
        if (!$this->dataSource instanceof ServerSideInterface) {
            throw new Exception('You must call this method when use server side data source.');
        }

        $response = new Response();
        $request = new Request();

        $this->dataSource->getResponse($response, $request);

        return $response;
    }
1013146
public function getBody(): RequestBody
    {
        if ($this->body === null) {
            $this->body = new RequestBody(new InMemoryStream);
        }

        return $this->body;
    }
354151
public function getRawBody()
    {
        if ($this->_rawBody === null) {
            $this->_rawBody = $this->swooleRequest->rawContent();
        }
        return $this->_rawBody;
    }
753657
protected function getResponse()
	{
		$response = trim($this->connection->readLine());

		switch(substr($response, 0, 1))
		{
			case '-': // error reply
				return $this->handleErrorResponse($response);
				break;
			case '+': // status reply
				return $this->handleStatusResponse($response);
				break;
			case ':': // integer reply
				return $this->handleIntegerResponse($response);
				break;
			case '$': // bulk reply
				return $this->handleBulkResponse($response);
				break;
			case '*': // multi-bulk reply
				return $this->handleMultiBulkResponse($response);
				break;
			default:
				throw new RedisException(vsprintf('Unable to handle server response [ %s ].', [$response]));
		}
	}
1195674
final public function getResponse()
    {
        if (empty($this->response)) {
            $httpMethod = $this->getRequest()
                ? strtoupper($this->getRequest()->getMethod())
                : 'GET'
            ;

            if ($this->isHttpMethodSupported($httpMethod)) {
                $functionName = $this->getFunctionName($httpMethod);
                Logger::get()->debug("Running responder method '$functionName'...");
                // If the responder is a restricted one...
                if ($this instanceof \Eix\Core\Responders\Restricted) {
                    // ... ensure the user is allowed to use that function.
                    Users::getCurrent()->checkAuthorisation($this, $functionName);
                }

                // The response is the result of executing the appropriate
                // responder function.
                $this->response = $this->$functionName();
            } else {
                throw new \Eix\Services\Net\Http\MethodNotAllowedException("This responder does not support {$httpMethod} requests.");
            }
        }

        return $this->response;
    }
712550
public function getRequestBody()
    {
        $body = [
            'status' => $this->getContent(),
        ];

        if ($this->imageIds) {
            $body['media_ids'] = $this->imageIds->implode(',');
        }

        return $body;
    }
1169454
protected function getErrorResponse()
    {
        if (Request::ajax()) {
            throw new AjaxException('Element not found');
        }

        return Response::make($this->controller->run('404')->getContent(), 404);
    }
446521
public function getDatabaseInfo($name = null)
    {
        $response = $this->httpClient->request('GET', '/'.($name ? urlencode($name) : $this->databaseName));

        if ($response->status != 200) {
            throw HTTPException::fromResponse('/'.urlencode($name), $response);
        }

        return $response->body;
    }