Skip to content

Commit d3e192a

Browse files
committed
Added exception catching to command system
1 parent c337d1c commit d3e192a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/org/javawebstack/framework/WebApplication.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ public WebApplication(){
6464
crypt = new Crypt(config.has("crypt.key") ? config.get("crypt.key") : Crypt.generateKey());
6565
injector.setInstance(Crypt.class, crypt);
6666

67-
addSeeder("all", new AllSeeder());
68-
6967
modules.forEach(m -> m.setupConfig(this, config));
7068
if(config.get("database.driver", "none").equalsIgnoreCase("sqlite")){
7169
sql = new SQLite(config.get("database.file", "db.sqlite"));
@@ -115,6 +113,7 @@ public WebApplication(){
115113
modules.forEach(m -> m.beforeSetupSeeding(this));
116114
setupSeeding();
117115
modules.forEach(m -> m.setupSeeding(this));
116+
addSeeder("all", new AllSeeder());
118117

119118
setupCommands(commandSystem);
120119
modules.forEach(m -> m.setupCommands(this, commandSystem));
@@ -254,7 +253,11 @@ protected void setupSeeding(){}
254253
public void run(String[] args){
255254
if(args == null)
256255
args = new String[]{"start"};
257-
commandSystem.run(args);
256+
try {
257+
commandSystem.run(args);
258+
}catch (Throwable t){
259+
t.printStackTrace();
260+
}
258261
}
259262

260263
public void start(){

0 commit comments

Comments
 (0)