Skip to content

delete Command insufficient Error Message for Extra Parameters* #4

Description

@bbryant824

Bug Report: delete Command insufficient Error Message for Extra Parameters

Title: delete command fails to handle extra parameters correctly and provides unhelpful error message.


Steps to Reproduce

  1. Launch LegacyLink.
  2. Enter the command:
    delete 1 1

Expected Behavior

  • The application should detect the extra parameter and display a clear, specific error message, such as:
    "Invalid command format! The delete command accepts only one parameter: delete INDEX."
  • The command should only accept a single integer as the index, with no additional spaces between the integers.

Actual Behavior

  • The application shows a generic error message:
    ' delete: Deletes the person identified by the index number used in the displayed person list.
    Parameters: INDEX (must be a positive integer)
    Example: delete 1`

  • The error message does not explicitly point out the issue of having extra parameters, leaving the user unclear about what went wrong.


Severity

severity.Low


Type

type.FunctionalityBug


Why This Is a Problem

  • Ambiguous Error Feedback: The current error message does not explain that the command failed due to extra parameters, leading to user confusion.
  • Command Format Integrity: The delete command should strictly enforce the rule of accepting only one integer parameter with no spaces or additional inputs.
  • User Frustration: Users may struggle to identify the cause of the error, especially if they accidentally include extra spaces or numbers.

Suggestions for Improvement

  1. Enhance error message clarity to explicitly state that extra parameters are not allowed. For example:
    "Invalid command format! The delete command accepts only one parameter: delete INDEX."
  2. Implement stricter validation to ensure the command format only accepts a single integer with no additional spaces or parameters.
  3. Add test cases to ensure the error handling logic properly identifies and responds to commands with extra parameters.

Screenshot 2024-11-08 at 4.51.26 PM.png

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions