Skip to content

Commit 2df3146

Browse files
committed
Update Client.php
1 parent 75d0bc4 commit 2df3146

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/PHPLicengine/Service/Client.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ public function __construct ($base_url, $api_key)
3636

3737
$response = $this->get($this->url.'/');
3838
if (!$this->isCurlError()) {
39-
if (!$response->isValidResponse()) {
40-
throw new ResponseException ("Invalid PHPLicengine URL.");
39+
if ($response->isOk()) {
40+
if (!$response->isValidResponse()) {
41+
throw new ResponseException ("Invalid PHPLicengine URL.");
42+
}
43+
} else {
44+
throw new ResponseException ("Error ".$response->getResponseCode()." : ".$response->getReasonPhrase());
4145
}
4246
} else {
4347
throw new CurlException ("Curl Connection: ".$this->getCurlErrno()." : ".$this->getCurlError());

0 commit comments

Comments
 (0)