Skip to content

Commit

Permalink
✨ 优化端口占用的异常提示
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Jun 6, 2024
1 parent 2756b9c commit ab89e16
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,16 @@ public boolean start() {
try {
tioServer.start(this.serverCreator.getIp(), this.serverCreator.getPort());
} catch (IOException e) {
throw new IllegalStateException("Mica mqtt tcp server start fail.", e);
String message = String.format("Mica mqtt tcp server port %d start fail.", this.serverCreator.getPort());
throw new IllegalStateException(message, e);
}
// 3. 启动 mqtt web
if (webServer != null) {
try {
webServer.start();
} catch (IOException e) {
throw new IllegalStateException("Mica mqtt http/websocket server start fail.", e);
String message = String.format("Mica mqtt http/websocket server port %d start fail.", this.serverCreator.getWebPort());
throw new IllegalStateException(message, e);
}
}
return true;
Expand Down

0 comments on commit ab89e16

Please sign in to comment.