File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 15
15
### Fixed
16
16
- Fixed an error that could occur when calling ` craft\webhooks\Plugin::getRequestData() ` if an invalid request ID was passed.
17
17
- Fixed an exception that could occur when retrying webhook requests, if the queue driver didn’t support delayed jobs.
18
+ - Fixed an exception that could occur when sending webhook requests, if Guzzle wasn’t able to connect to the server.
18
19
19
20
## 2.3.3 - 2021-04-01
20
21
Original file line number Diff line number Diff line change 25
25
use DateTime ;
26
26
use GuzzleHttp \Exception \GuzzleException ;
27
27
use GuzzleHttp \Exception \RequestException ;
28
+ use GuzzleHttp \Exception \TransferException ;
28
29
use GuzzleHttp \RequestOptions ;
29
30
use ReflectionClass ;
30
31
use Throwable ;
@@ -391,13 +392,16 @@ public function sendRequest(int $requestId): bool
391
392
->execute ();
392
393
393
394
$ startTime = microtime (true );
395
+ $ response = null ;
394
396
try {
395
397
$ response = Craft::createGuzzleClient ($ this ->getSettings ()->guzzleConfig )
396
398
->request ($ data ['method ' ], $ data ['url ' ], $ options );
397
399
$ success = true ;
398
- } catch (RequestException $ e ) {
399
- $ response = $ e ->getResponse ();
400
+ } catch (TransferException $ e ) {
400
401
$ success = false ;
402
+ if ($ e instanceof RequestException) {
403
+ $ response = $ e ->getResponse ();
404
+ }
401
405
}
402
406
403
407
// Update the request
You can’t perform that action at this time.
0 commit comments