Skip to content

Commit 2120d51

Browse files
committed
Log request exceptions
1 parent 2378141 commit 2120d51

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Changed
1212
- Webhooks now requires Craft 3.7 or later.
1313
- Improved the performance of clearing out completed webhook request logs. ([#32](https://github.com/craftcms/webhooks/issues/32))
14+
- Exceptions thrown for webhook requests are now logged.
1415

1516
### Fixed
1617
- Fixed an error that could occur when calling `craft\webhooks\Plugin::getRequestData()` if an invalid request ID was passed.

src/Plugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ public function sendRequest(int $requestId): bool
402402
if ($e instanceof RequestException) {
403403
$response = $e->getResponse();
404404
}
405+
Craft::warning("Unable to send webhook: {$e->getMessage()}", __METHOD__);
406+
Craft::$app->getErrorHandler()->logException($e);
405407
}
406408

407409
// Update the request

0 commit comments

Comments
 (0)