Skip to content

[PE-D][Tester C] Inconsistent error messages for invalid indices across index-based commands #316

@nus-pe-bot

Description

@nus-pe-bot

For each index-based command, try a negative index and an out-of-range positive index:

  • delete-contact -1
  • delete-contact 99
  • edit-contact -1
  • edit-contact 99
  • delete-member -1
  • delete-member 99

Expected:

Any invalid index (negative or out-of-bounds) should produce a consistent, index-related error message.

Actual (examples):

  • delete-contact -1 → “Invalid command format”
  • delete-contact 99 → “The contact index provided is out of range”
  • edit-contact -1 → “Invalid command format!”
  • edit-contact 99 → “At least one field to edit must be provided.”
  • delete-member -1 → “Invalid command format!”
  • delete-member 99 → “Invalid command format!”

Image

Image

Image

Image

Image

Image

Why this is a problem:

Users making the same mistake (invalid index) receive different categories of errors across commands and even within the same command, which is confusing and slows recovery.

Suggested Improvements:

  • Standardize invalid-index handling across all index-based commands so both negative and out-of-range indices always yield the same index-related error message.

  • Ensure index validity is checked first, so unrelated messages (e.g., “At least one field to edit must be provided.”) don’t mask the index error.


Labels: severity.Low type.FunctionalityBug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions