Skip to content

Commit

Permalink
added curl errno
Browse files Browse the repository at this point in the history
  • Loading branch information
cl77 committed Apr 26, 2024
1 parent a9f94ac commit 453d4bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ protected function request(string $path, string $method, array $options = []): m
$res = curl_exec($ch);

$curl_error = curl_error($ch);
$curl_errno = curl_errno($ch);
curl_close($ch);

if (false === $res) throw new UnexpectedValueException($curl_error);
if (false === $res) throw new UnexpectedValueException("cURL Error: " . $curl_error, $curl_errno);

try {
$res = json_decode($res, false, 512, JSON_THROW_ON_ERROR);
Expand Down

0 comments on commit 453d4bb

Please sign in to comment.