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

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-04-13 08:54:02 +02:00
parent 21b056ee2d
commit b7c1e61d0b
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205

View file

@ -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);
}
}
}