From 8cde670efdcf4113a99a7ab27a3de680d4f43b0d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 24 Aug 2020 12:54:11 +0200 Subject: [PATCH] log all errors to error log --- src/main/java/com/sparrowwallet/sparrow/MainApp.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/MainApp.java b/src/main/java/com/sparrowwallet/sparrow/MainApp.java index 1d14b2d7..f8cce20d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/MainApp.java +++ b/src/main/java/com/sparrowwallet/sparrow/MainApp.java @@ -14,6 +14,7 @@ import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import org.controlsfx.glyphfont.GlyphFontRegistry; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.List; @@ -24,6 +25,12 @@ public class MainApp extends Application { private Stage mainStage; + @Override + public void init() throws Exception { + Thread.setDefaultUncaughtExceptionHandler((t, e) -> LoggerFactory.getLogger(MainApp.class).error("Exception in thread \"" + t.getName() + "\"", e)); + super.init(); + } + @Override public void start(Stage stage) throws Exception { this.mainStage = stage;