From 61b814ee5503245c3cd7429b170cf05f37e8f878 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 6 Mar 2024 14:14:05 +0100 Subject: [PATCH 1/2] MailQueueHandler: Don't flood logs with useless messages Signed-off-by: Marcel Klehr --- lib/MailQueueHandler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php index b820b550d..a1ceda8a0 100644 --- a/lib/MailQueueHandler.php +++ b/lib/MailQueueHandler.php @@ -467,6 +467,10 @@ protected function parseEvent($lang, IEvent $event) { try { $event = $provider->parse($lang, $event); } catch (\Throwable $e) { + if ($e instanceof \InvalidArgumentException) { + // \InvalidArgumentException is part of the activity API, so we let it through + throw $e; + } $this->logger->error('Error while parsing activity event', ['exception' => $e]); } } From 971d53b416b39ffa635a4bcb31333a595a9904cb Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 14 Mar 2024 11:32:19 +0100 Subject: [PATCH 2/2] Don't rethrow InvalidArgumentException MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Marcel Klehr --- lib/MailQueueHandler.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php index a1ceda8a0..2bca5fd34 100644 --- a/lib/MailQueueHandler.php +++ b/lib/MailQueueHandler.php @@ -466,11 +466,9 @@ protected function parseEvent($lang, IEvent $event) { foreach ($this->activityManager->getProviders() as $provider) { try { $event = $provider->parse($lang, $event); + } catch (\InvalidArgumentException $e) { + /* Ignore */ } catch (\Throwable $e) { - if ($e instanceof \InvalidArgumentException) { - // \InvalidArgumentException is part of the activity API, so we let it through - throw $e; - } $this->logger->error('Error while parsing activity event', ['exception' => $e]); } }