mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修改异常包装策略:运行时异常不包装,只包装非运行时异常
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
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.UrlBuilder;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
@@ -79,7 +80,7 @@ public class JdkClientEngine implements ClientEngine {
|
||||
} catch (final IOException e) {
|
||||
// 出错后关闭连接
|
||||
IoUtil.closeQuietly(this);
|
||||
throw new RuntimeException(e);
|
||||
throw new IORuntimeException(e);
|
||||
}
|
||||
|
||||
return sendRedirectIfPossible(message, isAsync);
|
||||
|
@@ -557,7 +557,7 @@ public class JakartaServletUtil {
|
||||
writer.write(text);
|
||||
writer.flush();
|
||||
} catch (final IOException e) {
|
||||
throw new HutoolException(e);
|
||||
throw new IORuntimeException(e);
|
||||
} finally {
|
||||
IoUtil.closeQuietly(writer);
|
||||
}
|
||||
|
@@ -568,7 +568,7 @@ public class ServletUtil {
|
||||
writer.write(text);
|
||||
writer.flush();
|
||||
} catch (final IOException e) {
|
||||
throw new HutoolException(e);
|
||||
throw new IORuntimeException(e);
|
||||
} finally {
|
||||
IoUtil.closeQuietly(writer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user