Browse Source

implement getError method

main
ghost 9 months ago
parent
commit
5b5764939d
  1. 23
      src/Client.php

23
src/Client.php

@ -85,24 +85,23 @@ class Client @@ -85,24 +85,23 @@ class Client
bool $json = true
): ?array
{
$response = curl_exec(
$this->_curl
);
if ($response = curl_exec($this->_curl))
{
return $json ? json_decode($response, true) : $response;
}
return null;
}
$errorNumber = curl_errno(
public function getError(?int &$code = null): mixed
{
$code = curl_errno(
$this->_curl
);
$errorText = curl_error(
return curl_error(
$this->_curl
);
if ($response)
{
return $json ? json_decode($response, true) : $response;
}
return null;
}
public function getBlockCount(): ?int

Loading…
Cancel
Save