yuechen2001 / pe

0 stars 0 forks source link

Non-specific error message for invalid emails #6

Open yuechen2001 opened 7 months ago

yuechen2001 commented 7 months ago

Steps to reproduce:

  1. Enter this command: "add n/James Ho p/22224444 e/ @example.com a/123,Clementi Rd, 1234665 t/friend t/colleague"
  2. Error message shown: Emails should be of the format local-part@domain and adhere to the following constraints:
  3. The local-part should only contain alphanumeric characters and these special characters, excluding the parentheses, (+_.-). The local-part may not start or end with any special characters.
  4. This is followed by a '@' and then a domain name. The domain name is made up of domain labels separated by periods. The domain name must:
    • end with a domain label at least 2 characters long
    • have each domain label start and end with alphanumeric characters
    • have each domain label consist of alphanumeric characters, separated only by hyphens, if any.

Expected: An error message specific to the invalid email (missing local-part) should be displayed. Actual: A long string of error message that encompasses numerous potential issues

image.png

Good catch on the invalid email! However, I would like to suggest this improvement on the error message shown:

nus-pe-bot commented 7 months ago

Team's Response

Adding more specific parsing is a nice to have, but the current error message is correct, and encompasses the problem shown above. Thanks for the suggestion on how to fix, it is probably how I'd implement this fix too!

IMAGE 2024-04-21 23:05:55.jpg

Items for the Tester to Verify

:question: Issue response

Team chose [response.NotInScope]

Reason for disagreement: [replace this with your explanation]