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 handling of error messages on decoding errors. #734

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

rgallardo-netflix
Copy link
Contributor

Ensure that all code paths that can throw a type error will log it properly and with as much information as possible.

Ensure that all code paths that can throw a type error will log it properly and with as much information as possible.
@@ -130,7 +131,7 @@ public <T> Property<T> asType(Function<String, T> mapper, String defaultValue) {
try {
return mapper.apply(value);
} catch (Exception e) {
LOG.warn("Invalid value '{}' for property '{}'", propName, value);
LOG.error("Invalid value '{}' for property '{}'. Will return the default instead.", propName, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think due to the implementation of the above asType method, this just ends up returning null (this is what we observed in https://netflix.slack.com/archives/C141EJAJU/p1723751704356699)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I saw that. It's the same as in the get() method. I'll delve into fixing those two and any others I find in a separate PR, I want that one to be as clean as I can so it can be called out in the release notes and also it's easy to pinpoint if/when people complain about a behavior change.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK LGTM if this is assuming we are changing to that behavior, though this error message is technically a little off until we get to that point

@rgallardo-netflix rgallardo-netflix merged commit 3191c48 into 2.x Sep 25, 2024
10 checks passed
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.

3 participants