diff options
author | Marcel Klehr <mklehr@gmx.net> | 2024-08-01 09:02:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 09:02:26 +0200 |
commit | 5d98b647d67d1db04fc4cefb72e866a96a4ec11e (patch) | |
tree | 4fab7b38b251419b9fa6ec5d6f7d9ee16c93083a /lib/private/TaskProcessing/Manager.php | |
parent | 75f80cbdcbfee506d3e3741d98b1decfbb4da3c1 (diff) | |
parent | 1205379f5a77ec1f626dd535b83c9d98b6b224ef (diff) | |
download | nextcloud-server-5d98b647d67d1db04fc4cefb72e866a96a4ec11e.tar.gz nextcloud-server-5d98b647d67d1db04fc4cefb72e866a96a4ec11e.zip |
Merge pull request #46872 from nextcloud/fix/taskprocessing/dont-break-with-provider-errors
fix(TaskProcessing): Don't break if provider methods throw
Diffstat (limited to 'lib/private/TaskProcessing/Manager.php')
-rw-r--r-- | lib/private/TaskProcessing/Manager.php | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index cb1e4e1e041..dbb85e50637 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -678,20 +678,24 @@ class Manager implements IManager { continue; } $taskType = $taskTypes[$provider->getTaskTypeId()]; - $availableTaskTypes[$provider->getTaskTypeId()] = [ - 'name' => $taskType->getName(), - 'description' => $taskType->getDescription(), - 'optionalInputShape' => $provider->getOptionalInputShape(), - 'inputShapeEnumValues' => $provider->getInputShapeEnumValues(), - 'inputShapeDefaults' => $provider->getInputShapeDefaults(), - 'inputShape' => $taskType->getInputShape(), - 'optionalInputShapeEnumValues' => $provider->getOptionalInputShapeEnumValues(), - 'optionalInputShapeDefaults' => $provider->getOptionalInputShapeDefaults(), - 'outputShape' => $taskType->getOutputShape(), - 'outputShapeEnumValues' => $provider->getOutputShapeEnumValues(), - 'optionalOutputShape' => $provider->getOptionalOutputShape(), - 'optionalOutputShapeEnumValues' => $provider->getOptionalOutputShapeEnumValues(), - ]; + try { + $availableTaskTypes[$provider->getTaskTypeId()] = [ + 'name' => $taskType->getName(), + 'description' => $taskType->getDescription(), + 'optionalInputShape' => $provider->getOptionalInputShape(), + 'inputShapeEnumValues' => $provider->getInputShapeEnumValues(), + 'inputShapeDefaults' => $provider->getInputShapeDefaults(), + 'inputShape' => $taskType->getInputShape(), + 'optionalInputShapeEnumValues' => $provider->getOptionalInputShapeEnumValues(), + 'optionalInputShapeDefaults' => $provider->getOptionalInputShapeDefaults(), + 'outputShape' => $taskType->getOutputShape(), + 'outputShapeEnumValues' => $provider->getOutputShapeEnumValues(), + 'optionalOutputShape' => $provider->getOptionalOutputShape(), + 'optionalOutputShapeEnumValues' => $provider->getOptionalOutputShapeEnumValues(), + ]; + } catch (\Throwable $e) { + $this->logger->error('Failed to set up TaskProcessing provider ' . $provider::class, ['exception' => $e]); + } } $this->availableTaskTypes = $availableTaskTypes; |