forked from j62/ctbrec
1
0
Fork 0

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