diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index b0400c79a59..9b8714ee74b 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -19,7 +19,7 @@ Add changes here for all PR submitted to the 2.x branch. ### feature: - +- [[#7599](https://github.com/apache/incubator-seata/pull/7485)] Optimize the exception message - [[#7485](https://github.com/apache/incubator-seata/pull/7485)] Add http request filter for seata-server - [[#7509](https://github.com/apache/incubator-seata/pull/7509)] Reuse connection to merge branch transactions - [[#7492](https://github.com/apache/incubator-seata/pull/7492)] upgrade HTTP client in common module to support HTTP/2 diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 981153aff70..d2d47c17b53 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -20,6 +20,7 @@ ### feature: +- [[#7599](https://github.com/apache/incubator-seata/pull/7485)] 优化异常消息 - [[#7485](https://github.com/apache/incubator-seata/pull/7485)] 给seata-server端的http请求添加过滤器 - [[#7509](https://github.com/apache/incubator-seata/pull/7509)] 复用连接合并分支事务 - [[#7492](https://github.com/apache/incubator-seata/pull/7492)] 升级 common 模块中的 HTTP 客户端以支持 HTTP/2 diff --git a/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientBootstrap.java b/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientBootstrap.java index dd732eaa6ad..fda4097d7fa 100644 --- a/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientBootstrap.java +++ b/core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientBootstrap.java @@ -180,9 +180,11 @@ public Channel getNewChannel(InetSocketAddress address) { try { f.await(this.nettyClientConfig.getConnectTimeoutMillis(), TimeUnit.MILLISECONDS); if (f.isCancelled()) { - throw new FrameworkException(f.cause(), "connect cancelled, can not connect to services-server."); + throw new FrameworkException( + f.cause(), "connect cancelled, can not connect to services-server:" + address.toString() + "."); } else if (!f.isSuccess()) { - throw new FrameworkException(f.cause(), "connect failed, can not connect to services-server."); + throw new FrameworkException( + f.cause(), "connect failed, can not connect to services-server:" + address.toString() + "."); } else { channel = f.channel(); } @@ -208,8 +210,10 @@ public void handlerAdded(ChannelHandlerContext ctx) { channel = bootstrap.open().get(); } + } catch (FrameworkException frameworkException) { + throw frameworkException; } catch (Exception e) { - throw new FrameworkException(e, "can not connect to services-server."); + throw new FrameworkException(e, "can not connect to services-server:" + address.toString() + "."); } return channel;