package org.jabref;

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

/**
 * Catch and log any unhandled exceptions.
 */
public class FallbackExceptionHandler implements Thread.UncaughtExceptionHandler {

    private static final Logger LOGGER = LoggerFactory.getLogger(FallbackExceptionHandler.class);

    public static void installExceptionHandler() {
        Thread.setDefaultUncaughtExceptionHandler(new FallbackExceptionHandler());
    }

    @Override
    public void uncaughtException(Thread thread, Throwable exception) {
        LOGGER.error("Uncaught exception occurred in " + thread, exception);
        JabRefGUI.getMainFrame()
                 .getDialogService()
                 .showErrorDialogAndWait(
                                         exception.getLocalizedMessage(), exception);
    }
}

@@ -14,16 +14,65 @@
 abref;%0A%0A
+import org.jabref.gui.util.DefaultTaskExecutor;%0A%0A
 import o
@@ -655,24 +655,85 @@
 exception);%0A
+%0A        DefaultTaskExecutor.runInJavaFXThread(() -%3E%0A        
         JabR
@@ -770,16 +770,24 @@
         
+   
+     
 .getDial
@@ -794,24 +794,32 @@
 ogService()%0A
+        
             
@@ -851,81 +851,50 @@
 ait(
-%0A                                         exception.getLocalizedMessage()
+%22Uncaught exception occurred in %22 + thread
 , ex
@@ -901,16 +901,26 @@
 ception)
+%0A        )
 ;%0A    %7D%0A

Fix not on FX thread exception