Replace Exception parameter with Throwable
This commit is contained in:
parent
a7ab34c9d7
commit
7b7c7b24b1
|
@ -5,14 +5,14 @@ import javafx.application.Platform;
|
|||
import javafx.scene.control.Alert;
|
||||
|
||||
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 = () -> {
|
||||
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Error");
|
||||
alert.setHeaderText(header);
|
||||
String content = text;
|
||||
if(e != null) {
|
||||
content += " " + e.getLocalizedMessage();
|
||||
if(t != null) {
|
||||
content += " " + t.getLocalizedMessage();
|
||||
}
|
||||
alert.setContentText(content);
|
||||
alert.showAndWait();
|
||||
|
|
Loading…
Reference in New Issue