Skip to content

Commit 453d4bb

Browse files
committed
added curl errno
1 parent a9f94ac commit 453d4bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BaseClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ protected function request(string $path, string $method, array $options = []): m
8181
$res = curl_exec($ch);
8282

8383
$curl_error = curl_error($ch);
84+
$curl_errno = curl_errno($ch);
8485
curl_close($ch);
8586

86-
if (false === $res) throw new UnexpectedValueException($curl_error);
87+
if (false === $res) throw new UnexpectedValueException("cURL Error: " . $curl_error, $curl_errno);
8788

8889
try {
8990
$res = json_decode($res, false, 512, JSON_THROW_ON_ERROR);

0 commit comments

Comments
 (0)