修复请求报错404等情况下导致ResponseBody未关闭的问题

pull/908/head
dsk 2023-06-25 16:00:37 +08:00
parent f4e5e03962
commit cec266d3cd
1 changed files with 1 additions and 1 deletions

View File

@ -192,10 +192,10 @@ public class ZLMRESTfulUtils {
} else { } else {
logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message()));
} }
Objects.requireNonNull(response.body()).close();
} else { } else {
logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message())); logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message()));
} }
Objects.requireNonNull(response.body()).close();
} catch (ConnectException e) { } catch (ConnectException e) {
logger.error(String.format("连接ZLM失败: %s, %s", e.getCause().getMessage(), e.getMessage())); logger.error(String.format("连接ZLM失败: %s, %s", e.getCause().getMessage(), e.getMessage()));
logger.info("请检查media配置并确认ZLM已启动..."); logger.info("请检查media配置并确认ZLM已启动...");