From 151004110f5a770062b7854eb916a666d545991c Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 19 Oct 2020 00:24:17 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=98=8E=E7=A1=AE=E5=87=BA=E9=94=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chanjar/weixin/common/util/http/HttpResponseProxy.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/HttpResponseProxy.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/HttpResponseProxy.java index 49d8b2a74..f338ece67 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/HttpResponseProxy.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/HttpResponseProxy.java @@ -58,7 +58,7 @@ public class HttpResponseProxy { private String getFileName(CloseableHttpResponse response) throws WxErrorException { Header[] contentDispositionHeader = response.getHeaders("Content-disposition"); if (contentDispositionHeader == null || contentDispositionHeader.length == 0) { - throw new WxErrorException("无法获取到文件名"); + throw new WxErrorException("无法获取到文件名,Content-disposition为空"); } return this.extractFileNameFromContentString(contentDispositionHeader[0].getValue()); @@ -76,7 +76,7 @@ public class HttpResponseProxy { private String extractFileNameFromContentString(String content) throws WxErrorException { if (content == null || content.length() == 0) { - throw new WxErrorException("无法获取到文件名"); + throw new WxErrorException("无法获取到文件名,content为空"); } Matcher m = PATTERN.matcher(content); @@ -84,7 +84,7 @@ public class HttpResponseProxy { return m.group(1); } - throw new WxErrorException("无法获取到文件名"); + throw new WxErrorException("无法获取到文件名,header信息有问题"); } }