aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-09-15 22:09:01 +0200
committerGitHub <noreply@github.com>2024-09-15 22:09:01 +0200
commit6bc75b85f1bf5839a7dc85321d9ddb22dd3c1086 (patch)
treef69890d56066e4087a986f7f618ff76995181214 /lib/private
parent97aa0f70871524d83653aa4003806efedec86629 (diff)
parent2853496dbb4dab38a3a02b90a72f14d343566830 (diff)
downloadnextcloud-server-6bc75b85f1bf5839a7dc85321d9ddb22dd3c1086.tar.gz
nextcloud-server-6bc75b85f1bf5839a7dc85321d9ddb22dd3c1086.zip
Merge pull request #47804 from nextcloud/backport/47801/stable30
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/TaskProcessing/Manager.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php
index 5316414e8fb..988b34491c1 100644
--- a/lib/private/TaskProcessing/Manager.php
+++ b/lib/private/TaskProcessing/Manager.php
@@ -891,7 +891,8 @@ class Manager implements IManager {
if ($error !== null) {
$task->setStatus(Task::STATUS_FAILED);
$task->setEndedAt(time());
- $task->setErrorMessage($error);
+ // truncate error message to 1000 characters
+ $task->setErrorMessage(mb_substr($error, 0, 1000));
$this->logger->warning('A TaskProcessing ' . $task->getTaskTypeId() . ' task with id ' . $id . ' failed with the following message: ' . $error);
} elseif ($result !== null) {
$taskTypes = $this->getAvailableTaskTypes();
@@ -956,7 +957,7 @@ class Manager implements IManager {
$this->taskMapper->update($taskEntity);
$this->runWebhook($task);
} catch (\OCP\DB\Exception $e) {
- throw new \OCP\TaskProcessing\Exception\Exception('There was a problem finding the task', 0, $e);
+ throw new \OCP\TaskProcessing\Exception\Exception($e->getMessage());
}
if ($task->getStatus() === Task::STATUS_SUCCESSFUL) {
$event = new TaskSuccessfulEvent($task);