Skip to content

Commit

Permalink
feat: add custom uncaught exception handler to log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sillydan1 committed Dec 3, 2022
1 parent a0efd2c commit b9c188c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/dk/cs/aau/huppaal/HUPPAAL.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ private void forceCreateFolder(final String directoryPath) throws IOException {
FileUtils.forceMkdir(directory);
}

@Override
public void init() {
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
try {
Log.addError(t.getName(), e.getMessage());
} catch(Throwable throwable) {
throwable.printStackTrace();
}
e.printStackTrace();
});
}

@Override
public void start(final Stage stage) throws Exception {
// Load or create new project
Expand Down

0 comments on commit b9c188c

Please sign in to comment.