mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
5cbe209c23
commit
834f93c116
@ -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);
|
||||
}
|
||||
|
||||
// 自定义重定向
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
// 自定义重定向
|
||||
|
Loading…
x
Reference in New Issue
Block a user