Permalink
Browse files

Fix exception when application.mode is something else then DEV or PROD

[#1593]

[#1593] Don't default to dev mode : Make it a fatal error
  • Loading branch information...
Igmar Palsenberg authored and Notalifeform committed Jan 16, 2013
1 parent 3b031bc commit e5ddac3de1932fe5983515887082af0992ee138a
Showing with 7 additions and 2 deletions.
  1. +7 −2 framework/src/play/Play.java
@@ -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;
}

0 comments on commit e5ddac3

Please sign in to comment.