diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php index 2f383b124ea93..30276f32b8706 100644 --- a/core/Controller/TaskProcessingApiController.php +++ b/core/Controller/TaskProcessingApiController.php @@ -179,8 +179,8 @@ private function handleScheduleTaskInternal( return new DataResponse([ 'task' => $json, ]); - } catch (PreConditionNotMetException) { - return new DataResponse(['message' => $this->l->t('The given provider is not available')], Http::STATUS_PRECONDITION_FAILED); + } catch (PreConditionNotMetException $e) { + return new DataResponse(['message' => $e->getMessage()], Http::STATUS_PRECONDITION_FAILED); } catch (ValidationException $e) { return new DataResponse(['message' => $e->getMessage()], Http::STATUS_BAD_REQUEST); } catch (UnauthorizedException) {