Skip to content

Commit

Permalink
Merge pull request #9 from bigloser/sshah/allow_devconf_to_be_skipped
Browse files Browse the repository at this point in the history
allow dev.conf to be missing
  • Loading branch information
Jacob Rosenberg committed Mar 10, 2016
2 parents 9036247 + 57db2c8 commit 9dcc86d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions framework/src/play/Play.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,12 @@ public static void guessFrameworkPath() {
*/
public static void readConfiguration() {
confs = new HashSet<VirtualFile>();
configuration = readOneConfigurationFile("application.conf");
try {
configuration = readOneConfigurationFile("application.conf");
} catch (RuntimeException e) {
Logger.fatal("Cannot read application.conf, exiting...");
fatalServerErrorOccurred();
}
extractHttpPort();
// Plugins
pluginCollection.onConfigurationRead();
Expand All @@ -370,14 +375,7 @@ private static Properties readOneConfigurationFile(String filename) {
throw new RuntimeException("Detected recursive @include usage. Have seen the file " + filename + " before");
}

try {
propsFromFile = IO.readUtf8Properties(conf.inputstream());
} catch (RuntimeException e) {
if (e.getCause() instanceof IOException) {
Logger.fatal("Cannot read "+filename);
fatalServerErrorOccurred();
}
}
propsFromFile = IO.readUtf8Properties(conf.inputstream());
confs.add(conf);

// OK, check for instance specifics configuration
Expand Down

0 comments on commit 9dcc86d

Please sign in to comment.