aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/TextToImage/Manager.php9
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');
}
/**