diff options
author | Anupam Kumar <kyteinsky@gmail.com> | 2024-09-06 17:23:31 +0530 |
---|---|---|
committer | Anupam Kumar <kyteinsky@gmail.com> | 2024-09-06 18:01:56 +0530 |
commit | bb94b17959c5d2a911968f33a02b536484d00bcf (patch) | |
tree | 3b9cfb18b5642f49b5b8ba4d392a3a8b7b363706 /lib | |
parent | 46340d1d398548aa1a93607b7b13852146f50c9e (diff) | |
download | nextcloud-server-bb94b17959c5d2a911968f33a02b536484d00bcf.tar.gz nextcloud-server-bb94b17959c5d2a911968f33a02b536484d00bcf.zip |
fix(TaskProcessing): increase error_message column length
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/TaskProcessing/Manager.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 1b170a03ec2..29153ca56f9 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); |