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

Improve error message for invalid input #473

Closed
remkop opened this issue Sep 9, 2018 · 0 comments
Closed

Improve error message for invalid input #473

remkop opened this issue Sep 9, 2018 · 0 comments

Comments

@remkop
Copy link
Owner

remkop commented Sep 9, 2018

Related to checkstyle/checkstyle#6082 :

Currently the error message for invalid input is not very user-friendly.

For example, if a non-numeric value is specified for an option of type int:

Could not convert 'invalid' to int for option '--tree-walker-threads-number': java.lang.NumberFormatException: For input string: "invalid"

Another example: if an invalid value if specified for an enum:

Could not convert 'xmlp' to OutputFormat for option '-f': java.lang.IllegalArgumentException: No enum constant com.puppycrawl.tools.checkstyle.Main.OutputFormat.xmlp

Instead:

  • Invalid value for option '--tree-walker-threads-number': 'invalid' could not be converted to 'int'. (java.lang.NumberFormatException: For input string: "invalid")
  • Invalid value 'xmlp' for option '-f': valid values are [xml, plain].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant