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

Reduce the scope of the try-catch block in ArgsParser::parse #1989

Closed
chan-j-d opened this issue Apr 10, 2023 · 2 comments · Fixed by #2074
Closed

Reduce the scope of the try-catch block in ArgsParser::parse #1989

chan-j-d opened this issue Apr 10, 2023 · 2 comments · Fixed by #2074

Comments

@chan-j-d
Copy link
Contributor

public static CliArguments parse(String[] args) throws HelpScreenException, ParseException {
try {

Currently, the above try block covers the entire method. The scope of it should be reduced to cover only the method/s that throw these exceptions.

@MarcusTXK
Copy link
Member

@nseah21 I noticed you made a PR addressing both #1989 and #1990 on your fork, nseah21#1. Would you like to make a PR to RepoSense directly?

Also as a side note, we try to only address a single issue per PR, so it would be good if you could split that PR up before merging it in.

@nseah21
Copy link
Contributor

nseah21 commented Dec 23, 2023

@MarcusTXK I have split the original PR and opened two separate PRs for issues #1989 and #1990.

chan-j-d pushed a commit that referenced this issue Dec 31, 2023
The old scope of the try block in ArgsParser::parse 
is too permissive, making it less apparent which 
methods throw the associated exceptions.

Let's reduce the scope of the try block in 
ArgsParser::parse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed/Completed
Development

Successfully merging a pull request may close this issue.

3 participants