From 57db2c84a6a7fb4f3df213b6176776fc49773160 Mon Sep 17 00:00:00 2001 From: Sumit Shah Date: Thu, 3 Mar 2016 11:25:12 -0800 Subject: [PATCH] allow dev.conf to be missing --- framework/src/play/Play.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/framework/src/play/Play.java b/framework/src/play/Play.java index 6824c5624a..2e7306423f 100644 --- a/framework/src/play/Play.java +++ b/framework/src/play/Play.java @@ -345,7 +345,12 @@ public static void guessFrameworkPath() { */ public static void readConfiguration() { confs = new HashSet(); - configuration = readOneConfigurationFile("application.conf"); + try { + configuration = readOneConfigurationFile("application.conf"); + } catch (RuntimeException e) { + Logger.fatal("Cannot read application.conf, exiting..."); + fatalServerErrorOccurred(); + } extractHttpPort(); // Plugins pluginCollection.onConfigurationRead(); @@ -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