mirror of
https://gitee.com/dromara/hutool.git
synced 2025-12-05 03:17:49 +08:00
fix code
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.dromara.hutool.http.client.engine.jdk;
|
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.io.IoUtil;
|
||||||
import org.dromara.hutool.core.net.url.UrlUtil;
|
import org.dromara.hutool.core.net.url.UrlUtil;
|
||||||
import org.dromara.hutool.core.util.ObjUtil;
|
import org.dromara.hutool.core.util.ObjUtil;
|
||||||
@@ -96,7 +95,7 @@ public class JdkClientEngine extends AbstractClientEngine {
|
|||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
// 出错后关闭连接
|
// 出错后关闭连接
|
||||||
IoUtil.closeQuietly(conn);
|
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.OkHttpClient;
|
||||||
import okhttp3.internal.http.HttpMethod;
|
import okhttp3.internal.http.HttpMethod;
|
||||||
import org.dromara.hutool.core.io.IORuntimeException;
|
|
||||||
import org.dromara.hutool.core.lang.Assert;
|
import org.dromara.hutool.core.lang.Assert;
|
||||||
import org.dromara.hutool.core.util.ObjUtil;
|
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.ClientConfig;
|
||||||
import org.dromara.hutool.http.client.Request;
|
import org.dromara.hutool.http.client.Request;
|
||||||
import org.dromara.hutool.http.client.RequestContext;
|
import org.dromara.hutool.http.client.RequestContext;
|
||||||
@@ -153,7 +153,7 @@ public class OkHttpEngine extends AbstractClientEngine {
|
|||||||
try {
|
try {
|
||||||
response = client.newCall(buildRequest(message)).execute();
|
response = client.newCall(buildRequest(message)).execute();
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new IORuntimeException(e);
|
throw new HttpException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自定义重定向
|
// 自定义重定向
|
||||||
|
|||||||
Reference in New Issue
Block a user