-
Notifications
You must be signed in to change notification settings - Fork 967
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
Adds trace while allowing missing file by returing empty parse value #550
Conversation
Hi @sathiyapk, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
I did sign the CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Seems useful to me.
@@ -180,6 +180,8 @@ final private AbstractConfigValue parseValue(ConfigOrigin origin, | |||
return rawParseValue(origin, finalOptions); | |||
} catch (IOException e) { | |||
if (finalOptions.getAllowMissing()) { | |||
trace(e.getMessage() + ". Allowing Missing File, this can be turned off by setting" + | |||
" ConfigParseOptions.allowMissing = false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the filename end up in this message somehow? (not sure if it's in getMessage or added by trace or what)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@havocp thanks for your comment!
This is one of the messages from trace:
resource not found on classpath: nothere.json. Allowing Missing File, this can be turned off by setting ConfigParseOptions.allowMissing = false
So i think it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! thanks again
Adds trace while allowing missing file by returing empty parse value
People come from Java background would expect
FileNotFoundException
if there's any problem in reading a file. But for some reason, the default value of theConfigParseOptions.allowMissing
is set to true, so i think i would be helpful to log this info. I kept it undertrace
, so it would help people who wanted to debug what's going wrong.