Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor command error messages #148

Merged
merged 7 commits into from
Nov 2, 2024

Conversation

ZShunRen
Copy link

@ZShunRen ZShunRen commented Oct 31, 2024

The error message for add command is not specific, and does not tell the user which of their flags are missing.
In addition, the error messages for add command are too long, requiring the user to horizontally scroll to the right to read it in full.
This can reduce readability.

The proper command messages have been formatted to have more

  1. line breaks
  2. clear section demarkers.
    The error message for add command is also able to inform the user which flag is missing.

Minor changes:.

  1. Build.gradle file will now ignore docs, this is so that we can reduce the file size to < 100 MB.

Closes #161

When a user uses a command with multiple flags wrong, namely `add` and
`edit`, the error message only displays an error for the first invalid
flag.

Now the error message is cumulative, allowing users to correct multiple
wrong flag values with 1 error message.
Copy link

@FionaQY FionaQY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Good job on the clean code and on updating all the tests.


// multiple invalid values but with purely optional fields, only the first in order of logical parsing is
// captured
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is still necessary

Copy link

@iamdiluxedbutcooler iamdiluxedbutcooler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work on implementing this upgrade!

* @param <T> The return type of the method supplied by this supplier.
*/
@FunctionalInterface
public interface ThrowingSupplier<T> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice abstraction with ThrowingSupplier!

exclude('**/META-INF/*.SF', '**/META-INF/*.DSA', '**/META-INF/*.RSA')
exclude('**/*.md') // Markdown files
exclude('**/*.txt') // Text files
// exclude('**/*.png', '**/*.jpg') // Images, if not required

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to clean up this commented lines later!

@@ -26,7 +26,6 @@ public void toModelType_typicalPersonsFile_success() throws Exception {
JsonSerializableAgentAssist.class).get();
AgentAssist agentAssistFromFile = dataFromFile.toModelType();
AgentAssist typicalPersonsAgentAssist = TypicalPersons.getTypicalAgentAssist();
System.out.println("Agent Assist: " + agentAssistFromFile);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise you left that in as a debugging comment, let me add that back!

@ZShunRen ZShunRen merged commit b8f1ef3 into AY2425S1-CS2103T-T14-4:master Nov 2, 2024
3 checks passed
@ZShunRen ZShunRen added this to the v1.5 milestone Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error messages can be refined
3 participants