Skip to content

Commit

Permalink
Fix not on FX thread exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Jan 23, 2019
1 parent 232c345 commit c6a1fcb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/org/jabref/FallbackExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref;

import org.jabref.gui.util.DefaultTaskExecutor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -17,9 +19,11 @@ public static void installExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable exception) {
LOGGER.error("Uncaught exception occurred in " + thread, exception);
JabRefGUI.getMainFrame()
.getDialogService()
.showErrorDialogAndWait(
exception.getLocalizedMessage(), exception);

DefaultTaskExecutor.runInJavaFXThread(() ->
JabRefGUI.getMainFrame()
.getDialogService()
.showErrorDialogAndWait("Uncaught exception occurred in " + thread, exception)
);
}
}

0 comments on commit c6a1fcb

Please sign in to comment.