diff options
author | Anna Larch <anna@nextcloud.com> | 2021-06-14 11:25:46 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2021-06-14 11:25:46 +0300 |
commit | cc29931388c6d03f92ccc96da049aa73e94c3974 (patch) | |
tree | e4b97b52481c75edea653be972f55549084961ee /lib/Service | |
parent | 574f1f010106cb850c6a4f0eeff3a0a815593a10 (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.php | 7 |
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)"); |