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:
parent
00782d4c17
commit
c0e1490530
|
@ -65,10 +65,14 @@ public class CamrecApplication extends Application {
|
|||
hostServices = getHostServices();
|
||||
createRecorder();
|
||||
for (Site site : sites) {
|
||||
site.setRecorder(recorder);
|
||||
site.init();
|
||||
if (!Objects.equals(System.getenv("CTBREC_DEV"), "1")) {
|
||||
site.login();
|
||||
try {
|
||||
site.setRecorder(recorder);
|
||||
site.init();
|
||||
if (!Objects.equals(System.getenv("CTBREC_DEV"), "1")) {
|
||||
site.login();
|
||||
}
|
||||
} catch(Exception e) {
|
||||
LOG.error("Error while initializing site {}", site.getName(), e);
|
||||
}
|
||||
}
|
||||
createGui(primaryStage);
|
||||
|
|
Loading…
Reference in New Issue