This commit is contained in:
Looly 2024-12-09 23:26:31 +08:00
parent 5cbe209c23
commit 834f93c116
2 changed files with 3 additions and 4 deletions

View File

@ -16,7 +16,6 @@
package org.dromara.hutool.http.client.engine.jdk;
import org.dromara.hutool.core.io.IORuntimeException;
import org.dromara.hutool.core.io.IoUtil;
import org.dromara.hutool.core.net.url.UrlUtil;
import org.dromara.hutool.core.util.ObjUtil;
@ -96,7 +95,7 @@ public class JdkClientEngine extends AbstractClientEngine {
} catch (final IOException e) {
// 出错后关闭连接
IoUtil.closeQuietly(conn);
throw new IORuntimeException(e);
throw new HttpException(e);
}
// 自定义重定向

View File

@ -18,9 +18,9 @@ package org.dromara.hutool.http.client.engine.okhttp;
import okhttp3.OkHttpClient;
import okhttp3.internal.http.HttpMethod;
import org.dromara.hutool.core.io.IORuntimeException;
import org.dromara.hutool.core.lang.Assert;
import org.dromara.hutool.core.util.ObjUtil;
import org.dromara.hutool.http.HttpException;
import org.dromara.hutool.http.client.ClientConfig;
import org.dromara.hutool.http.client.Request;
import org.dromara.hutool.http.client.RequestContext;
@ -153,7 +153,7 @@ public class OkHttpEngine extends AbstractClientEngine {
try {
response = client.newCall(buildRequest(message)).execute();
} catch (final IOException e) {
throw new IORuntimeException(e);
throw new HttpException(e);
}
// 自定义重定向