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

Introduce friendlier NumberFormatException messages #426

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

gastaldi
Copy link
Contributor

Required for quarkusio/quarkus#2292

Here is a sample output with this patch:

ᐅ java -Dquarkus.log.console.darken=1.3 -jar target/greeting-quarkus-0.1.0-runner.jar
Oct 21, 2020 4:02:12 PM io.quarkus.config
ERROR: An invalid value was given for configuration key "quarkus.log.console.darken": Expected an integer value but got "1.3"
Oct 21, 2020 4:02:12 PM io.quarkus.runtime.ApplicationLifecycleManager run
ERROR: Failed to start application (with profile prod)
io.quarkus.runtime.configuration.ConfigurationException: One or more configuration errors has prevented the application from starting. The errors are:
An invalid value was given for configuration key "quarkus.log.console.darken": Expected an integer value but got "1.3"

Without it the message is: An invalid value was given for configuration key "quarkus.log.console.darken": For input string: "1.5"

@gastaldi
Copy link
Contributor Author

/cc @dmlloyd @radcortez @kenfinnigan

Copy link
Member

@radcortez radcortez left a comment

Choose a reason for hiding this comment

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

Thanks @gastaldi

I suggested for you to map the exceptions in ConfigMessages.

gastaldi added a commit to gastaldi/smallrye-converters that referenced this pull request Oct 21, 2020
gastaldi added a commit to gastaldi/smallrye-converters that referenced this pull request Oct 21, 2020
@gastaldi
Copy link
Contributor Author

@radcortez done 👍

@radcortez
Copy link
Member

Thanks!

@radcortez radcortez added this to the 1.9.3 milestone Oct 21, 2020
@radcortez radcortez merged commit 7258a16 into smallrye:master Oct 21, 2020
radcortez pushed a commit to smallrye/smallrye-converters that referenced this pull request Oct 21, 2020
* Introduce friendlier NumberFormatException messages

Follow-up to smallrye/smallrye-config#426

* Add .cache to .gitignore
@gastaldi gastaldi deleted the number_format branch October 22, 2020 12:40
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.

2 participants