diff --git a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/IntervalMusicCompositorUI.java b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/IntervalMusicCompositorUI.java index e709254..bdc0cb2 100644 --- a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/IntervalMusicCompositorUI.java +++ b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/IntervalMusicCompositorUI.java @@ -86,7 +86,7 @@ public IntervalMusicCompositorUI(final MusicListControl musicListControl, private void installUncaughtExceptionHandler() { Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> { - messageProducer.send(new ErrorMessage(throwable.getMessage())); + messageProducer.send(new ErrorMessage(throwable)); messageProducer.send(new DebugMessage(IntervalMusicCompositorUI.this, throwable)); }); } diff --git a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/mainscreen/MainScreenController.java b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/mainscreen/MainScreenController.java index 6c35ff0..f31a3df 100644 --- a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/mainscreen/MainScreenController.java +++ b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/mainscreen/MainScreenController.java @@ -506,7 +506,7 @@ private void showErrorMessage(String message) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setResizable(true); alert.setTitle(bundle.getString("ui.error.title")); - alert.setContentText(message); + alert.setContentText(message + "\n\n" + bundle.getString("ui.error.appendix")); alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label).forEach(node -> ((Label)node).setMinHeight(Region.USE_PREF_SIZE)); alert.show(); }); diff --git a/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_de.properties b/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_de.properties index df89843..5919240 100644 --- a/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_de.properties +++ b/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_de.properties @@ -4,6 +4,7 @@ ui.instructions = Ziehe Musikdateien (der unterstützten Formate MP3, OGG, FLAC, # Error stuff ui.error.title = Interval Music Compositor - Fehler +ui.error.appendix = (Siehe unter "Hilfe" -> "Ereignisanzeige" für Details.) # About box ui.about.title = Über diff --git a/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_en.properties b/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_en.properties index b93e4e8..49a3eec 100644 --- a/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_en.properties +++ b/intervalmusiccompositor.fxUi/src/main/resources/ui_imc_en.properties @@ -3,6 +3,7 @@ ui.instructions = Drag and drop music files (supported formats: MP3, OGG, FLAC, # Error stuff ui.error.title = IntervalMusicCompositor - Error +ui.error.appendix = (See "Help" -> "Debug log" for more information.) # About box ui.about.title = About diff --git a/intervalmusiccompositor.model/src/main/java/ch/retorte/intervalmusiccompositor/messagebus/ErrorMessage.java b/intervalmusiccompositor.model/src/main/java/ch/retorte/intervalmusiccompositor/messagebus/ErrorMessage.java index 915bbfa..a6ba43f 100644 --- a/intervalmusiccompositor.model/src/main/java/ch/retorte/intervalmusiccompositor/messagebus/ErrorMessage.java +++ b/intervalmusiccompositor.model/src/main/java/ch/retorte/intervalmusiccompositor/messagebus/ErrorMessage.java @@ -9,4 +9,18 @@ public ErrorMessage(String message) { super(message); } + public ErrorMessage(Throwable throwable) { + super(getMessageFrom(throwable)); + } + + private static String getMessageFrom(Throwable throwable) { + String message = throwable.getMessage(); + if (message != null) { + return message; + } + else { + return throwable.getClass().getSimpleName(); + } + } + }