mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
connection: added error message for failed connection on wrongly configured server (related to #12768, #6197)
This commit is contained in:
parent
45ded61d6f
commit
350b41391a
1 changed files with 12 additions and 0 deletions
|
|
@ -505,6 +505,7 @@ public class SessionImpl implements Session {
|
|||
}
|
||||
if (t.toString().contains("to make private")) {
|
||||
// example: Unable to make private void java.io.ObjectOutputStream.clear() accessible: module java.base does not "opens java.io" to unnamed module
|
||||
// TODO: show that error as error dialog, so users can report to github
|
||||
message = "Wrong java version - check your client running scripts and params." + message;
|
||||
break;
|
||||
}
|
||||
|
|
@ -512,6 +513,17 @@ public class SessionImpl implements Session {
|
|||
message = '\n' + t.getCause().getMessage() + message;
|
||||
logger.debug(t.getCause().getMessage());
|
||||
}
|
||||
|
||||
if (t.getCause() == null) {
|
||||
// last chance to find real reason
|
||||
if (Arrays.stream(t.getStackTrace()).anyMatch(stack -> Objects.equals("ObjectInputStream.java", stack.getFileName()))) {
|
||||
// how-to fix: non-standard java version require additional params, see https://github.com/magefree/mage/issues/12768
|
||||
// TODO: show that error as error dialog, so users can report to github
|
||||
message = "Wrong client-server protocol - report to server's admin about compatibility problems. " + message;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
t = t.getCause();
|
||||
}
|
||||
client.showMessage("Unable connect to server. " + message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue