Skip to content

Commit 1fbd8e2

Browse files
author
容联云通讯
committedApr 21, 2021
网络请求异常时代码处理优化
1 parent 873368a commit 1fbd8e2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

Diff for: ‎pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>com.cloopen</groupId>
88
<artifactId>java-sms-sdk</artifactId>
99
<packaging>jar</packaging>
10-
<version>1.0.4</version>
10+
<version>1.0.3</version>
1111
<name>java-sms-sdk</name>
1212
<url>https://www.yuntongxun.com</url>
1313
<description>Yuntongxun Open API SDK for Java</description>

Diff for: ‎src/main/java/com/cloopen/rest/sdk/CCPRestSmsSDK.java

+4
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ private HashMap<String, Object> send(String to, String templateId, String[] data
157157
log.info("sendTemplateSMS Request url:" + url);
158158
log.info("sendTemplateSMS Request body:" + requsetbody);
159159
String result = HttpClientUtil.post(url,authorization,requsetbody,BODY_TYPE, Constant.UTF8);
160+
if (result == null || result == "")
161+
{
162+
return getMyError("172001", "网络错误");
163+
}
160164
try {
161165
if (BODY_TYPE == BodyType.Type_JSON) {
162166
return jsonToMap(result);

0 commit comments

Comments
 (0)
Please sign in to comment.