Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2021-06-14 11:25:46 +0300
committerAnna Larch <anna@nextcloud.com>2021-06-14 11:25:46 +0300
commitcc29931388c6d03f92ccc96da049aa73e94c3974 (patch)
treee4b97b52481c75edea653be972f55549084961ee /lib/Service
parent574f1f010106cb850c6a4f0eeff3a0a815593a10 (diff)
Wrap Exceptions in ServiceException and remove Throwable
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/Classification/PersistenceService.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Service/Classification/PersistenceService.php b/lib/Service/Classification/PersistenceService.php
index 5d364f451..b9ba94fa1 100644
--- a/lib/Service/Classification/PersistenceService.php
+++ b/lib/Service/Classification/PersistenceService.php
@@ -183,7 +183,12 @@ class PersistenceService {
throw new ServiceException("Could not load classifier $id: " . $e->getMessage(), 0, $e);
}
- $serialized = $modelFile->getContent();
+ try {
+ $serialized = $modelFile->getContent();
+ } catch (NotFoundException | NotPermittedException $e) {
+ $this->logger->debug("Could not load content for model file with classifier id $id: " . $e->getMessage());
+ throw new ServiceException("Could not load content for model file with classifier id $id: " . $e->getMessage(), 0, $e);
+ }
$size = strlen($serialized);
$this->logger->debug("Serialized classifier loaded (size=$size)");