forked from External/mage
GUI: reworked error dialog:
* added client version and improved stack trace; * added copy to clipboard button; * added button to create new issue on github (with prefilled form fields like error text); * added GUI size settings support; * some old errors now use new error dialog instead message box;
This commit is contained in:
parent
2631b31b8a
commit
6c0f7ebb90
11 changed files with 284 additions and 125 deletions
|
|
@ -29,6 +29,8 @@ import java.awt.event.KeyEvent;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Client side implementation (process commands from a server)
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
public class CallbackClientImpl implements CallbackClient {
|
||||
|
|
@ -266,7 +268,7 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
}
|
||||
|
||||
case GAME_ERROR: {
|
||||
frame.showErrorDialog("Game Error", (String) callback.getData());
|
||||
frame.showErrorDialog("SERVER", "game error", (String) callback.getData());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -693,12 +695,8 @@ public class CallbackClientImpl implements CallbackClient {
|
|||
});
|
||||
}
|
||||
|
||||
private void handleException(Exception ex) {
|
||||
logger.fatal("Client error\n", ex);
|
||||
String errorMessage = ex.getMessage();
|
||||
if (errorMessage == null || errorMessage.isEmpty() || errorMessage.equals("Null")) {
|
||||
errorMessage = ex.getClass().getSimpleName() + " - look at server or client logs for more details";
|
||||
}
|
||||
frame.showError("Server's error: " + errorMessage);
|
||||
private void handleException(Exception e) {
|
||||
logger.fatal("General error\n", e);
|
||||
frame.showErrorDialog("General error", e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue