@Override
boolean validateConfig() {
String config_key = config.getString(SOME_KEY);
if(StringUtils.isEmpty(config_key)) {
throw new PlayException("Configuration error", "Could not find " + SOME_KEY + " in settings");
}
return true;
}
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/5379fe99-10fd-4508-9e54-7136bc924c19%40googlegroups.com.
If you call out to the underlying Typesafe Config object, then calling an undefined key will result in an exception.
On Wed, Feb 15, 2017 at 10:31 AM, ron <rauna...@gmail.com> wrote:
My solution looks like this at the moment. Let me know if there is a better way..@Override
boolean validateConfig() {
String config_key = config.getString(SOME_KEY);
if(StringUtils.isEmpty(config_key)) {
throw new PlayException("Configuration error", "Could not find " + SOME_KEY + " in settings");
}
return true;
}
On Wednesday, 15 February 2017 17:00:49 UTC, ron wrote:Is there an accepted method to test whether certain key/values have been defined in the config file, and if a value is missing, not start the server?
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/32869302-31d4-44ab-b726-d76834267c8f%40googlegroups.com.