fix(BaseAIService):发送请求方法中try/catch块捕获的应该是Exception而不是自定义的AIException

This commit is contained in:
FeiWuSama
2025-12-26 17:13:22 +08:00
parent b029e236d6
commit 49363c99ea

View File

@@ -66,7 +66,7 @@ public class BaseAIService {
httpRequest.setProxy(config.getProxy()); httpRequest.setProxy(config.getProxy());
} }
return httpRequest.execute(); return httpRequest.execute();
} catch (final AIException e) { } catch (final Exception e) {
throw new AIException("Failed to send GET request: " + e.getMessage(), e); throw new AIException("Failed to send GET request: " + e.getMessage(), e);
} }
} }
@@ -90,7 +90,7 @@ public class BaseAIService {
httpRequest.setProxy(config.getProxy()); httpRequest.setProxy(config.getProxy());
} }
return httpRequest.execute(); return httpRequest.execute();
} catch (final AIException e) { } catch (final Exception e) {
throw new AIException("Failed to send POST request" + e.getMessage(), e); throw new AIException("Failed to send POST request" + e.getMessage(), e);
} }
@@ -116,7 +116,7 @@ public class BaseAIService {
httpRequest.setProxy(config.getProxy()); httpRequest.setProxy(config.getProxy());
} }
return httpRequest.execute(); return httpRequest.execute();
} catch (final AIException e) { } catch (final Exception e) {
throw new AIException("Failed to send POST request" + e.getMessage(), e); throw new AIException("Failed to send POST request" + e.getMessage(), e);
} }
} }