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

Don't NPE when config option is not specified #269

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,18 @@ private static <T> T load(
if (result.isPresent()) {
return result.get();
} else {
String foundKeys;
if (map == null) {
foundKeys = "No keys found";
} else {
foundKeys = map.keySet().toString();
}
throw new RuntimeException(
"Unable to find required configuration " + readableName + ". Please set using one of:\n" +
"Environment Variable: " + envVar + "\n" +
"Java System Property: " + javaProp + "\n" +
"Entry in config/" + mapYmlFile + ".yml: " + mapKey + "\n" +
"Found following keys: " + map.keySet());
"Found following keys: " + foundKeys);
}
}

Expand Down