diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-10-26 11:16:15 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-10-26 11:16:15 +0200 |
commit | 47e13cd55b3e369629b8b15a9332f50102ac076c (patch) | |
tree | e39e93345d5fca54c4a12dd3c17c57ebf6101b0c /lib/private/TextToImage/Manager.php | |
parent | 8339b5b12857b2fc3a25b289cb063a90499d0da3 (diff) | |
download | nextcloud-server-47e13cd55b3e369629b8b15a9332f50102ac076c.tar.gz nextcloud-server-47e13cd55b3e369629b8b15a9332f50102ac076c.zip |
en(TextToImage): Use specific exception class instead of generic RuntimeException
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private/TextToImage/Manager.php')
-rw-r--r-- | lib/private/TextToImage/Manager.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php index eb3ee25b8e0..12f7db44a25 100644 --- a/lib/private/TextToImage/Manager.php +++ b/lib/private/TextToImage/Manager.php @@ -32,6 +32,7 @@ use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\IConfig; +use OCP\TextToImage\Exception\TaskFailureException; use OCP\TextToImage\Exception\TaskNotFoundException; use OCP\TextToImage\IManager; use OCP\TextToImage\Task; @@ -194,15 +195,11 @@ class Manager implements IManager { } catch (Exception $e) { $this->logger->warning('Failed to update database after Text2Image error', ['exception' => $e]); } - if ($e instanceof RuntimeException) { - throw $e; - } else { - throw new RuntimeException('Text2Image generation using provider "' . $provider->getName() . '" failed: ' . $e->getMessage(), 0, $e); - } + throw new TaskFailureException('Text2Image generation using provider "' . $provider->getName() . '" failed: ' . $e->getMessage(), 0, $e); } } - throw new RuntimeException('Could not run task'); + throw new TaskFailureException('Could not run task'); } /** |