1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-24 12:16:28 +01:00

Better handling of LauncherException in error dialogs.

This commit is contained in:
sk89q 2014-01-09 08:53:18 -08:00
parent 19c5e312fa
commit e60d556d02

View File

@ -9,6 +9,7 @@ package com.skcraft.launcher.swing;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.skcraft.launcher.LauncherException;
import com.skcraft.launcher.util.SwingExecutor;
import lombok.NonNull;
import lombok.extern.java.Log;
@ -351,10 +352,16 @@ public final class SwingHelper {
return;
}
String message = t.getLocalizedMessage();
String message;
if (t instanceof LauncherException) {
message = t.getLocalizedMessage();
t = t.getCause();
} else {
message = t.getLocalizedMessage();
if (message == null) {
message = _("errors.genericError");
}
}
log.log(Level.WARNING, "Task failed", t);
SwingHelper.showErrorDialog(owner, message, _("errorTitle"), t);
}