mirror of
https://github.com/kevachat/kevacoin-php.git
synced 2025-01-22 12:34:15 +00:00
implement getError method
This commit is contained in:
parent
8792ade0e5
commit
5b5764939d
@ -85,19 +85,7 @@ class Client
|
||||
bool $json = true
|
||||
): ?array
|
||||
{
|
||||
$response = curl_exec(
|
||||
$this->_curl
|
||||
);
|
||||
|
||||
$errorNumber = curl_errno(
|
||||
$this->_curl
|
||||
);
|
||||
|
||||
$errorText = curl_error(
|
||||
$this->_curl
|
||||
);
|
||||
|
||||
if ($response)
|
||||
if ($response = curl_exec($this->_curl))
|
||||
{
|
||||
return $json ? json_decode($response, true) : $response;
|
||||
}
|
||||
@ -105,6 +93,17 @@ class Client
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getError(?int &$code = null): mixed
|
||||
{
|
||||
$code = curl_errno(
|
||||
$this->_curl
|
||||
);
|
||||
|
||||
return curl_error(
|
||||
$this->_curl
|
||||
);
|
||||
}
|
||||
|
||||
public function getBlockCount(): ?int
|
||||
{
|
||||
$this->_id++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user