-
Notifications
You must be signed in to change notification settings - Fork 199
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
Configuration file related changes #1459
Conversation
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 user see a friendly message on invalid json attribute?
} catch (URISyntaxException e) { | ||
e.printStackTrace(); | ||
} finally { |
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.
} catch (URISyntaxException e) { | |
e.printStackTrace(); | |
} finally { | |
} catch (Throwable e) { | |
e.printStackTrace(); |
// If the startupLogger still have some issues being initialized, just print the error stack trace | ||
if(startupLogger == null) { | ||
if (isFriendlyException) { | ||
System.err.println(message); | ||
} else { | ||
t.printStackTrace(); | ||
} | ||
} |
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.
// If the startupLogger still have some issues being initialized, just print the error stack trace | |
if(startupLogger == null) { | |
if (isFriendlyException) { | |
System.err.println(message); | |
} else { | |
t.printStackTrace(); | |
} | |
} | |
if (isFriendlyException) { | |
System.err.println(message); | |
} else { | |
t.printStackTrace(); | |
} |
@@ -288,7 +288,7 @@ public static Configuration loadJsonConfigFile(Path configPath) throws IOExcepti | |||
long lastModifiedTime = attributes.lastModifiedTime().toMillis(); | |||
try (InputStream in = Files.newInputStream(configPath)) { | |||
Moshi moshi = MoshiBuilderFactory.createBuilderWithAdaptor(); | |||
JsonAdapter<Configuration> jsonAdapter = moshi.adapter(Configuration.class); | |||
JsonAdapter<Configuration> jsonAdapter = moshi.adapter(Configuration.class).failOnUnknown(); |
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.
nice
I was thinking to handle this in a new PR. I will create a work item for this. |
], | ||
"selfDiagnostics": { | ||
"level": "debug" | ||
} | ||
] |
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.
😄 👍
Enhancements:
Improve discoverability of configuration file syntax error
Fail on invalid config attributes instead of silently ignoring