From 1a03e2d09c051de650a7fc2d5564b69a49575cc3 Mon Sep 17 00:00:00 2001 From: Christoph Wurst <christoph@winzerhof-wurst.at> Date: Mon, 8 Jun 2020 16:17:45 +0200 Subject: [PATCH] Also catch throwable's during account sync Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> --- lib/Listener/NewMessageClassificationListener.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Listener/NewMessageClassificationListener.php b/lib/Listener/NewMessageClassificationListener.php index 0a8252a92..0f16d21f6 100644 --- a/lib/Listener/NewMessageClassificationListener.php +++ b/lib/Listener/NewMessageClassificationListener.php @@ -32,6 +32,7 @@ use OCA\Mail\Service\Classification\ImportanceClassifier; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\ILogger; +use Throwable; class NewMessageClassificationListener implements IEventListener { private const EXEMPT_FROM_CLASSIFICATION = [ @@ -78,7 +79,8 @@ class NewMessageClassificationListener implements IEventListener { $message->setFlagImportant(true); } } - } catch (ServiceException $e) { + } catch (Throwable|ServiceException $e) { + // TODO: remove Throwable catch once https://github.com/RubixML/RubixML/pull/69 landed here $this->logger->logException($e, [ 'message' => 'Could not classify incoming message importance: ' . $e->getMessage(), 'level' => ILogger::ERROR, -- GitLab