From df3489796bd3832b89800ef13f24b93f17058812 Mon Sep 17 00:00:00 2001 From: Tom Sommer Date: Thu, 13 Sep 2018 13:07:14 +0200 Subject: [PATCH] Throw an exception when trying an unsupported TLD, instead of returning empty data. --- src/Whois.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Whois.php b/src/Whois.php index 3bfdc8e7..16754cf3 100644 --- a/src/Whois.php +++ b/src/Whois.php @@ -250,13 +250,7 @@ public function lookup($query = '', $is_utf = true) */ public function unknown() { - unset($this->query['server']); - $this->query['status'] = 'error'; - $result = array('rawdata' => array()); - $result['rawdata'][] = $this->query['errstr'][] = $this->query['query'] . ' domain is not supported'; - $this->checkDns($result); - $this->fixResult($result, $this->query['query']); - return $result; + throw new \InvalidArgumentException($this->query['query'] . ' domain is not supported'); } /**