Skip to content

Commit

Permalink
Fix exception when application.mode is something else then DEV or PROD
Browse files Browse the repository at this point in the history
[#1593]

[#1593] Don't default to dev mode : Make it a fatal error
  • Loading branch information
Igmar Palsenberg authored and Notalifeform committed Jan 18, 2013
1 parent 3b031bc commit e5ddac3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions framework/src/play/Play.java
Expand Up @@ -240,8 +240,13 @@ public static void init(File root, String id) {
}

// Mode
mode = Mode.valueOf(configuration.getProperty("application.mode", "DEV").toUpperCase());
if (usePrecompiled || forceProd) {
try {
mode = Mode.valueOf(configuration.getProperty("application.mode", "DEV").toUpperCase());
} catch (IllegalArgumentException e) {
Logger.error("Illegal mode '%s', use either prod or dev", configuration.getProperty("application.mode"));
fatalServerErrorOccurred();
}
if (usePrecompiled || forceProd) {
mode = Mode.PROD;
}

Expand Down

0 comments on commit e5ddac3

Please sign in to comment.