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

Add more Exception messages for Config.getValue() #504

Merged
merged 3 commits into from
Feb 23, 2021

Conversation

Joseph-Cass
Copy link
Contributor

Partly addresses #485
In particular, resolves:

Under the current implementation all of the tests from ConfigValueConversionRulesExceptionsTest.java would have thrown

Property %s is required but the value was not found or is empty

Except from badConversion() which would have thrown:

Expected an integer value, got "notInt"

@radcortez
Copy link
Member

@Joseph-Cass Is this ready?

@Joseph-Cass
Copy link
Contributor Author

This comment may change depending on the outcome of this discussion, but other than that, I'm happy if you are :)

Signed-off-by: Joseph Cass <joseph.cass@ibm.com>
Signed-off-by: Joseph Cass <joseph.cass@ibm.com>
@Joseph-Cass
Copy link
Contributor Author

Does this look okay to you @radcortez ?

@radcortez radcortez added this to the 2.1.1 milestone Feb 23, 2021
@radcortez
Copy link
Member

Yes! Thank you!

@radcortez radcortez merged commit 7324f30 into smallrye:master Feb 23, 2021
@radcortez radcortez added backport-1.x Backport a PR to 1.x branch and removed backport-1.x Backport a PR to 1.x branch labels Feb 24, 2021
@radcortez radcortez linked an issue Mar 10, 2021 that may be closed by this pull request
@radcortez
Copy link
Member

Cannot backport to 1.x due to merge conflicts. Please backport manually:
Run:

git clone https://github.com/smallrye/smallrye-config.git
git fetch origin pull/504/head:pr-504
git checkout -b 1.x origin/1.x
git checkout -b backport-#504-to-1.x
# One or more of the following command will fail, you will need to fix the conflict manually
git cherry-pick ed53f84b2ba931cb9b217f1dc61373fb37465c45
git cherry-pick d091ce36e7784cec833058328684330848e4e5a2
git cherry-pick ac2c83fe02dea7543bca7e2b42e0830bd09f2370
# Once all commits have been cherry-picked:
git push --set-upstream origin backport-#504-to-1.x

To fix the conflict, first check which file is impacted using: git status
For each file with a resolved conflict, execute: git add $FILE
Then, commit the files using the same commit message as the original commit: git commit -m "..."

Once done and pushed, open the pull request.

@Joseph-Cass
Copy link
Contributor Author

@radcortez I'm not sure this PR is suitable for 1.x. It updates error messages related to "empty" and null behaviour which changed in the spec between MP Config 1.x -> 2.0?

@radcortez
Copy link
Member

Ahah, I was actually using this as a test for a script I wrote to do backports.

There are some interesting things that I would like to backport, but I haven't really tried it yet.

radcortez pushed a commit to radcortez/smallrye-config that referenced this pull request Mar 19, 2021
* Add more Exception messages for Config.getValue()

Signed-off-by: Joseph Cass <joseph.cass@ibm.com>
radcortez pushed a commit that referenced this pull request Mar 20, 2021
* Add more Exception messages for Config.getValue()

Signed-off-by: Joseph Cass <joseph.cass@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-1.x Backport a PR to 1.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print causing exception of ConfigValidationException
3 participants