Compare commits

...

3 Commits
master ... zhc

Author SHA1 Message Date
zhczyx@163.com 12c485c87f Merge branch 'master' of http://47.100.114.196:3001/jwy/aeon_tcp into zhc 1 month ago
zhczyx@163.com c1b9d95c41 fix(http): 处理非JSON格式的API响应 1 month ago
zhczyx@163.com e4cd975149 feat(session): 为CSDJ协议帧处理添加类型日志打印 1 month ago
  1. 10
      src/main/java/com/aeon/tcp/utils/DefaultHttpRequestUtil.java

10
src/main/java/com/aeon/tcp/utils/DefaultHttpRequestUtil.java

@ -27,7 +27,15 @@ public class DefaultHttpRequestUtil {
.execute()
.body();
logger.debug("resonponseJson: {}",responseJson);
MyHTTPResponse response = JSONUtil.parseObj(responseJson).toBean(MyHTTPResponse.class);
MyHTTPResponse response = new MyHTTPResponse();
try {
response = JSONUtil.parseObj(responseJson).toBean(MyHTTPResponse.class);
} catch (Exception e) {
logger.warn("API response is not JSON, raw response: {}", responseJson);
response.setCode(200);
response.setMsg("success");
}
return response;
}

Loading…
Cancel
Save