From 2eeb738da5747a43d8e4b75cd2296ebdeda31112 Mon Sep 17 00:00:00 2001 From: wuou <1521658453@qq.com> Date: Mon, 3 Nov 2025 11:02:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(transport):=20=E4=BF=AE=E5=A4=8D=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=90=86=E5=A4=84=E7=90=86=E5=99=A8=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用正确的日志记录方式记录异常堆栈信息 - 添加上下文关闭逻辑防止资源泄漏 --- LICENSE | 21 +++++++++++++++++++ .../transport/handler/DebugProxyHandler.java | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0ecef2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 wuou + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/debuggerx-transport/src/main/java/io/debuggerx/transport/handler/DebugProxyHandler.java b/debuggerx-transport/src/main/java/io/debuggerx/transport/handler/DebugProxyHandler.java index 614ee99..7ea50bf 100644 --- a/debuggerx-transport/src/main/java/io/debuggerx/transport/handler/DebugProxyHandler.java +++ b/debuggerx-transport/src/main/java/io/debuggerx/transport/handler/DebugProxyHandler.java @@ -103,7 +103,7 @@ public void channelInactive(ChannelHandlerContext ctx) { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause){ - log.error(cause.getMessage()); - log.error(cause.getCause().toString()); + log.error("Error", cause); + ctx.close(); } } \ No newline at end of file