Show a more informative error message for BindException. (fixes #119)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
f22498ae7d
commit
7dc5f973de
|
@ -62,6 +62,7 @@ public class ErrorHandler {
|
||||||
textArea.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
|
textArea.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
|
||||||
textArea.setTabSize(2);
|
textArea.setTabSize(2);
|
||||||
textArea.setLineWrap(true);
|
textArea.setLineWrap(true);
|
||||||
|
textArea.setWrapStyleWord(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Scroll pane holding JTextArea. */
|
/** Scroll pane holding JTextArea. */
|
||||||
|
|
|
@ -118,7 +118,12 @@ public class Opsu extends StateBasedGame {
|
||||||
try {
|
try {
|
||||||
SERVER_SOCKET = new ServerSocket(Options.getPort());
|
SERVER_SOCKET = new ServerSocket(Options.getPort());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
ErrorHandler.error(String.format("Another program is already running on port %d.", Options.getPort()), e, false);
|
ErrorHandler.error(String.format(
|
||||||
|
"opsu! could not be launched for one of these reasons:\n" +
|
||||||
|
"- An instance of opsu! is already running.\n" +
|
||||||
|
"- Another program is running on port %d. " +
|
||||||
|
"You can change the port opsu! uses by editing the \"Port\" field in the configuration file.",
|
||||||
|
Options.getPort()), null, false);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user