Make startup up of app make robust

Surround init of sites with try catch block, so that a failure
of a site does not tear down the whole app.
This commit is contained in:
0xboobface 2018-10-23 21:13:32 +02:00
parent 00782d4c17
commit c0e1490530
1 changed files with 8 additions and 4 deletions

View File

@ -65,10 +65,14 @@ public class CamrecApplication extends Application {
hostServices = getHostServices(); hostServices = getHostServices();
createRecorder(); createRecorder();
for (Site site : sites) { for (Site site : sites) {
site.setRecorder(recorder); try {
site.init(); site.setRecorder(recorder);
if (!Objects.equals(System.getenv("CTBREC_DEV"), "1")) { site.init();
site.login(); if (!Objects.equals(System.getenv("CTBREC_DEV"), "1")) {
site.login();
}
} catch(Exception e) {
LOG.error("Error while initializing site {}", site.getName(), e);
} }
} }
createGui(primaryStage); createGui(primaryStage);