diff --git a/src/Controller/AddTimeController.php b/src/Controller/AddTimeController.php index 74ab586..6e7e447 100644 --- a/src/Controller/AddTimeController.php +++ b/src/Controller/AddTimeController.php @@ -156,15 +156,15 @@ public function __invoke( if ($realException instanceof CanNotAssembleEmptyGroup) { $addTimeForm->addError(new FormError($this->translator->trans('forms.empty_group_error'))); - } - - if ($realException instanceof SuspiciousPpm) { + } elseif ($realException instanceof SuspiciousPpm) { + $addTimeForm->addError(new FormError($this->translator->trans('forms.too_high_ppm'))); + } else { $addTimeForm->addError(new FormError($this->translator->trans('forms.too_high_ppm'))); - } - $this->logger->warning('Puzzle time could not be added', [ - 'exception' => $exception, - ]); + $this->logger->warning('Puzzle time could not be added', [ + 'exception' => $exception, + ]); + } } } diff --git a/translations/messages.cs.yml b/translations/messages.cs.yml index 42d58a3..f038bd1 100644 --- a/translations/messages.cs.yml +++ b/translations/messages.cs.yml @@ -162,6 +162,7 @@ forms: required_field: "Toto pole je povinné!" empty_group_error: "Nelze vytvořit skupinu pouze sám se sebou, to pak není skupinové skládání :-)" too_high_ppm: "Prosím zkontrolujte si zadaný čas, takhle rychle puzzle určitě složit nedokážete! Čas se zadává ve formátu HH:MM:SS. Vámi zadaný čas by byl nový světový rekord! :-)" + unknown_error: "Došlo k nějaké neočekávané chybě :(. Byli jsme notifikování. Prosím zkuste to později." name_help: "Pod tímto jménem budete skládat puzzle a uvidí ho všichni členové komunity." email_help: "Váš e-mail je neveřejný, nikde se nezobrazuje a slouží pouze pro případ, aby vás mohl kontaktovat administrátor." location_help: "Místo, kde aktuálně pobýváte (nepovinné)." diff --git a/translations/messages.en.yml b/translations/messages.en.yml index 1757486..e58044c 100644 --- a/translations/messages.en.yml +++ b/translations/messages.en.yml @@ -161,6 +161,7 @@ forms: required_field: "This field is required!" empty_group_error: "You cannot create a group with yourself only, that's not group assembling :-)" too_high_ppm: "Please check the time you entered, there is no way you can solve the puzzle that fast! :-) The time should be entered in HH:MM:SS format. The time you entered would be a new world record! :-)" + unknown_error: "Some unexpected error happened :(. We have been notified. Please try again later." name_help: "Under this name you will assemble puzzles and it will be visible to all community members." email_help: "Your email is private, not displayed anywhere and is only used in case the administrator needs to contact you." location_help: "The place, you currently live at (optional)."