Skip to content

Commit

Permalink
Update Domrobot.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ddmler authored Mar 28, 2023
1 parent 4ced5f6 commit d86ed55
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Domrobot.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function setClTrId(string $clTrId): self
*
* @return array
*
* @throws ExceptionCallFailed
* @throws CallFailedException
*/
public function call(string $object, string $method, array $params = []): array
{
Expand Down Expand Up @@ -301,20 +301,20 @@ public function call(string $object, string $method, array $params = []): array
}

if($response === false) {
throw new ExceptionCallFailed('Curl failed to request from: ' . $this->url . $this->api . '/');
throw new CallFailedException('Curl failed to request from: ' . $this->url . $this->api . '/');
}

if ($this->isJson()) {
$result = json_decode($response, true);
if(!is_array($result)) {
throw new ExceptionCallFailed('Failed to decode json response: ' . var_export($response, true));
throw new CallFailedException('Failed to decode json response: ' . var_export($response, true));
}
return $result;
}

$result = xmlrpc_decode($response, 'UTF-8');
if(!is_array($result)) {
throw new ExceptionCallFailed('Failed to decode xmlrpc response: ' . var_export($response, true));
throw new CallFailedException('Failed to decode xmlrpc response: ' . var_export($response, true));
}
return $result;
}
Expand Down Expand Up @@ -363,7 +363,7 @@ protected function getSecretCode(string $secret): string
*
* @return array
*
* @throws ExceptionCallFailed
* @throws CallFailedException
*/
public function login(string $username, string $password, ?string $sharedSecret = null): array
{
Expand All @@ -388,7 +388,7 @@ public function login(string $username, string $password, ?string $sharedSecret
*
* @return array
*
* @throws ExceptionCallFailed
* @throws CallFailedException
*/
public function logout(): array
{
Expand Down

0 comments on commit d86ed55

Please sign in to comment.