Skip to content

Commit d91a365

Browse files
committed
Add hooks feature
1 parent b5c5544 commit d91a365

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Utils/Request.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ public function handleWithExceptions($callback)
7373

7474
public function doRequest($method, $path, $options = [])
7575
{
76-
foreach ($this->beforeRequestHooks as $hook) {
77-
$hook($method, $path, $options);
76+
try {
77+
foreach ($this->beforeRequestHooks as $hook) {
78+
$hook($method, $path, $options);
79+
}
80+
} catch (\Throwable $exception) {
81+
// silence hooks!!!
7882
}
7983

8084
return $this->curl->{$method}($path, $options);

0 commit comments

Comments
 (0)