Implement standardized error message templates #296
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#291 Epic: Input Validation Framework
aethyr/Aethyr
Reference: aethyr/Aethyr#296
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m1-error-templatesfeat: implement standardized error message templatesBackground and Context
Currently, error messages across command handlers are inconsistent — some are terse, some verbose, some use different terminology for the same concept. Standardized error message templates ensure players receive clear, consistent, and helpful feedback when validation fails. These templates are used by the validation pipeline and all validators.
Expected Behavior
A
ValidationMessagesmodule provides 15 templated error messages that accept interpolation parameters. Messages are player-friendly (no technical jargon), consistently formatted, and helpful (suggesting corrections where possible).The 15 templates:
unknown_command— "I don't understand '%{input}'."missing_required_param— "The %{param_name} is required."invalid_type— "'%{value}' is not a valid %{expected_type}."object_not_found— "You don't see '%{name}' here."player_not_found— "No player named '%{name}' is currently online."ambiguous_object— "Which %{name} do you mean? %{options}"direction_invalid— "'%{value}' is not a valid direction."permission_denied— "You cannot do that."too_many_params— "Too many words. Usage: %{usage}"not_enough_params— "Not enough detail. Usage: %{usage}"invalid_enum_value— "'%{value}' must be one of: %{valid_values}."target_not_in_scope— "You can't reach %{name} from here."number_out_of_range— "%{value} is out of range (%{min}–%{max})."action_not_possible— "You can't %{action} right now."cooldown_active— "You must wait %{seconds} seconds before doing that again."Acceptance Criteria
ValidationMessagesmodule is defined with all 15 template methods.Subtasks
Code
ValidationMessagesmodule.ValidationPipelineerror generation.ObjectFinder,DirectionValidator, andPlayerOnlineValidator.ParamDefinitionfor usage-related messages.Quality
tests/unit/error_templates.featurecovering all 15 message templates with interpolation, override mechanism, integration with pipeline errors, usage string generation.tests/integration/for standardized error messages appearing in player output during validation failures.bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/tests/unit/coverage/and use it to write new Cucumber based unit tests to improve coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerunbundle exec rake unitto verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.bundle exec rake(default task: unit tests with coverage) andbundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.Definition of Done
This issue is complete when:
master, reviewed, and merged before this issue is marked done.