fix(translation): Properly set the numbers as HTTP status code

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/37704/head
Joas Schilling 3 years ago
parent 21b056ee2d
commit b7c1e61d0b
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 4
      core/Controller/TranslationApiController.php

@ -72,9 +72,9 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
} catch (PreConditionNotMetException) {
return new DataResponse(['message' => $this->l->t('No translation provider available')], Http::STATUS_PRECONDITION_FAILED);
} catch (InvalidArgumentException) {
return new DataResponse(['message' => $this->l->t('Could not detect language'), Http::STATUS_NOT_FOUND]);
return new DataResponse(['message' => $this->l->t('Could not detect language')], Http::STATUS_NOT_FOUND);
} catch (RuntimeException) {
return new DataResponse(['message' => $this->l->t('Unable to translate'), Http::STATUS_INTERNAL_SERVER_ERROR]);
return new DataResponse(['message' => $this->l->t('Unable to translate')], Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
}

Loading…
Cancel
Save