/**
* 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);
}