From 34cc3b51b91fbf7eed78d7e50bc5b6645baa06de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Szalma?= Date: Fri, 18 Feb 2022 08:33:22 +0100 Subject: [PATCH] ignore http exceptions --- src/Notifier.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Notifier.php b/src/Notifier.php index bc35f8d..f3be9c5 100644 --- a/src/Notifier.php +++ b/src/Notifier.php @@ -319,7 +319,13 @@ public function sendNotice($notice) } $req = $this->newHttpRequest($notice); - $resp = $this->sendRequest($req); + try { + $resp = $this->sendRequest($req); + } catch (\Exception $e) { + // Not all exceptions are handled when 'http_errors' => false. Timeouts for example. We ignore these in general. + $notice['error'] = 'http send failed: ' . $e->getMessage(); + return $notice; + } return $this->processHttpResponse($notice, $resp); }