提交 ecf0917d authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved exception message when connecting to a just started server fails.

上级 ac5a6c06
...@@ -438,7 +438,8 @@ public class Server implements Runnable, ShutdownHandler { ...@@ -438,7 +438,8 @@ public class Server implements Runnable, ShutdownHandler {
public Server start() throws SQLException { public Server start() throws SQLException {
service.start(); service.start();
Thread t = new Thread(this); Thread t = new Thread(this);
t.setName(service.getName() + " (" + service.getURL() + ")"); String name = service.getName() + " (" + service.getURL() + ")";
t.setName(name);
t.start(); t.start();
for (int i = 1; i < 64; i += i) { for (int i = 1; i < 64; i += i) {
wait(i); wait(i);
...@@ -449,7 +450,7 @@ public class Server implements Runnable, ShutdownHandler { ...@@ -449,7 +450,7 @@ public class Server implements Runnable, ShutdownHandler {
if (isRunning(true)) { if (isRunning(true)) {
return this; return this;
} }
throw Message.getSQLException(ErrorCode.CONNECTION_BROKEN); throw Message.getSQLException(ErrorCode.EXCEPTION_OPENING_PORT_2, new String[] { name, "timeout" });
} }
private static void wait(int i) { private static void wait(int i) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论