1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00

* simplify error handling

This commit is contained in:
Reinhard Pointner 2015-11-09 05:55:12 +00:00
parent d647315dd8
commit 79a0dacdbc

View File

@ -173,22 +173,15 @@ public class Main {
}
// GUI mode => start user interface
try {
SwingUtilities.invokeAndWait(() -> {
try {
// use native laf an all platforms
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.getMessage(), e);
}
startUserInterface(args);
});
} catch (InvocationTargetException e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, e.getCause().getMessage(), e.getCause());
System.exit(-1); // starting up UI failed
} catch (InterruptedException e) {
throw new RuntimeException(e); // won't happen
}
SwingUtilities.invokeAndWait(() -> {
try {
// use native laf an all platforms
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.getMessage(), e);
}
startUserInterface(args);
});
// preload media.types (when loaded during DnD it will freeze the UI for a few hundred milliseconds)
MediaTypes.getDefault();
@ -216,7 +209,7 @@ public class Main {
System.exit(-1);
} catch (Throwable e) {
// unexpected error => dump stack
e.printStackTrace();
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Unexpected error during startup", e);
System.exit(-1);
}
}