GuzzleHttp\Exception\RequestException::hasResponse PHP Method

hasResponse() public method

Check if a response was received
public hasResponse ( ) : boolean
return boolean
    public function hasResponse()
    {
        return $this->response !== null;
    }

Usage Example

 /**
  * Converts a Guzzle exception into an Httplug exception.
  *
  * @param RequestException $exception
  *
  * @return Exception
  */
 private function createException(RequestException $exception)
 {
     if ($exception->hasResponse()) {
         return new HttpException($exception->getMessage(), $exception->getRequest(), $exception->getResponse(), $exception);
     }
     return new NetworkException($exception->getMessage(), $exception->getRequest(), $exception);
 }
All Usage Examples Of GuzzleHttp\Exception\RequestException::hasResponse