forked from j62/ctbrec
1
0
Fork 0

Replace Exception parameter with Throwable

This commit is contained in:
0xboobface 2018-12-16 17:50:56 +01:00
parent a7ab34c9d7
commit 7b7c7b24b1
1 changed files with 3 additions and 3 deletions

View File

@ -5,14 +5,14 @@ import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
public class Dialogs { public class Dialogs {
public static void showError(String header, String text, Exception e) { public static void showError(String header, String text, Throwable t) {
Runnable r = () -> { Runnable r = () -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText(header); alert.setHeaderText(header);
String content = text; String content = text;
if(e != null) { if(t != null) {
content += " " + e.getLocalizedMessage(); content += " " + t.getLocalizedMessage();
} }
alert.setContentText(content); alert.setContentText(content);
alert.showAndWait(); alert.showAndWait();