We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d03d76 commit c872ed5Copy full SHA for c872ed5
src/CurlHttpClient.php
@@ -15,6 +15,7 @@
15
16
namespace Pdp;
17
18
+use Throwable;
19
use function curl_close;
20
use function curl_errno;
21
use function curl_error;
@@ -52,8 +53,13 @@ public function __construct(array $options = [])
52
53
CURLOPT_HTTPGET => true,
54
];
55
- $curl = curl_init();
56
- $res = @curl_setopt_array($curl, $this->options);
+ try {
57
+ $curl = curl_init();
58
+ $res = @curl_setopt_array($curl, $this->options);
59
+ } catch (Throwable $exception) {
60
+ throw new Exception('Please verify your curl additionnal options', $exception->getCode(), $exception);
61
+ }
62
+
63
curl_close($curl);
64
if (!$res) {
65
throw new Exception('Please verify your curl additionnal options');
0 commit comments