mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
fix(BaseAIService):发送请求方法中try/catch块捕获的应该是Exception而不是自定义的AIException
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user