From 49363c99eadef2e3a988cfab3bfae1fdc833aa51 Mon Sep 17 00:00:00 2001 From: FeiWuSama <1825578184@qq.com> Date: Fri, 26 Dec 2025 17:13:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(BaseAIService):=E5=8F=91=E9=80=81=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=96=B9=E6=B3=95=E4=B8=ADtry/catch=E5=9D=97=E6=8D=95?= =?UTF-8?q?=E8=8E=B7=E7=9A=84=E5=BA=94=E8=AF=A5=E6=98=AFException=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E8=87=AA=E5=AE=9A=E4=B9=89=E7=9A=84AIExcepti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/hutool/ai/core/BaseAIService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java b/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java index 18d365a506..9af70e1910 100644 --- a/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java +++ b/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java @@ -66,7 +66,7 @@ public class BaseAIService { httpRequest.setProxy(config.getProxy()); } return httpRequest.execute(); - } catch (final AIException e) { + } catch (final Exception e) { throw new AIException("Failed to send GET request: " + e.getMessage(), e); } } @@ -90,7 +90,7 @@ public class BaseAIService { httpRequest.setProxy(config.getProxy()); } return httpRequest.execute(); - } catch (final AIException e) { + } catch (final Exception e) { throw new AIException("Failed to send POST request:" + e.getMessage(), e); } @@ -116,7 +116,7 @@ public class BaseAIService { httpRequest.setProxy(config.getProxy()); } return httpRequest.execute(); - } catch (final AIException e) { + } catch (final Exception e) { throw new AIException("Failed to send POST request:" + e.getMessage(), e); } }