Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/Cleantalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -461,6 +458,8 @@ private function httpRequest($msg) {
break;
}
}
} else {
throw TransportException::fromUrlHostError($url_host);
}
}

Expand Down
17 changes: 17 additions & 0 deletions lib/TransportException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Cleantalk;

use Exception;

class TransportException extends Exception
{
/**
* @param string $url
* @return self
*/
public static function fromUrlHostError($url_host)
{
return new self("Couldn't resolve host name for \"$url_host\".\nCheck your network connectivity.");
}
}