aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-04-13 08:54:48 +0200
committerJoas Schilling <coding@schilljs.com>2023-04-13 09:02:42 +0200
commit032821d2b530f51b9ae5ae51f27c07e6badb3056 (patch)
treecc7961f62dae562ebd61cd9d0d5f87246d2a045b /core
parentb7c1e61d0be967beaaf68ec6deb2823cf79d0580 (diff)
downloadnextcloud-server-032821d2b530f51b9ae5ae51f27c07e6badb3056.tar.gz
nextcloud-server-032821d2b530f51b9ae5ae51f27c07e6badb3056.zip
fix(translation): Use 400 as status code to be distinguishable from server errors
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/TranslationApiController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Controller/TranslationApiController.php b/core/Controller/TranslationApiController.php
index b8ae1db9fef..c8077987cb8 100644
--- a/core/Controller/TranslationApiController.php
+++ b/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_BAD_REQUEST);
} 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_BAD_REQUEST);
}
}
}