diff --git a/lib/Cleantalk.php b/lib/Cleantalk.php index 7cdc23f..edd41e9 100644 --- a/lib/Cleantalk.php +++ b/lib/Cleantalk.php @@ -444,10 +444,7 @@ private function httpRequest($msg) { return false; - } else { - - $servers = $this->get_servers_ip($url_host); - + } else if(null !== $servers = $this->get_servers_ip($url_host)) { // Loop until find work server foreach ($servers as $server) { @@ -461,6 +458,8 @@ private function httpRequest($msg) { break; } } + } else { + throw TransportException::fromUrlHostError($url_host); } } diff --git a/lib/TransportException.php b/lib/TransportException.php new file mode 100644 index 0000000..367f569 --- /dev/null +++ b/lib/TransportException.php @@ -0,0 +1,17 @@ +