Skip to content

Commit

Permalink
Feature: Message for unexpected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMikes committed Dec 19, 2024
1 parent 8cc6714 commit f4743fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Controller/AddTimeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions translations/messages.cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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é)."
Expand Down
1 change: 1 addition & 0 deletions translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
Expand Down

0 comments on commit f4743fe

Please sign in to comment.