File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -444,10 +444,7 @@ private function httpRequest($msg) {
444444
445445 return false ;
446446
447- } else {
448-
449- $ servers = $ this ->get_servers_ip ($ url_host );
450-
447+ } else if (null !== $ servers = $ this ->get_servers_ip ($ url_host )) {
451448 // Loop until find work server
452449 foreach ($ servers as $ server ) {
453450
@@ -461,6 +458,8 @@ private function httpRequest($msg) {
461458 break ;
462459 }
463460 }
461+ } else {
462+ throw TransportException::fromUrlHostError ($ url_host );
464463 }
465464 }
466465
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Cleantalk ;
4+
5+ use Exception ;
6+
7+ class TransportException extends Exception
8+ {
9+ /**
10+ * @param string $url
11+ * @return self
12+ */
13+ public static function fromUrlHostError ($ url_host )
14+ {
15+ return new self ("Couldn't resolve host name for \"$ url_host \". \nCheck your network connectivity. " );
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments