|
@@ -142,12 +142,15 @@ public class HttpUtil {
|
|
**/
|
|
**/
|
|
private static <T> T convertObject(String result, Class<T> clazz){
|
|
private static <T> T convertObject(String result, Class<T> clazz){
|
|
HttpContentVo<T> httpContentVo = JSONObject.parseObject(result, HttpContentVo.class);
|
|
HttpContentVo<T> httpContentVo = JSONObject.parseObject(result, HttpContentVo.class);
|
|
|
|
+ if (httpContentVo == null) {
|
|
|
|
+ throw BusinessException.builder(SyncErrorEnum.FAIL.getStatus(), "服务器访问繁忙,请稍后重试");
|
|
|
|
+ }
|
|
// 没有权限
|
|
// 没有权限
|
|
if (httpContentVo.getStatus() == AUTH_FAIL) {
|
|
if (httpContentVo.getStatus() == AUTH_FAIL) {
|
|
- throw BusinessException.builder(SyncErrorEnum.AUTH_FAIL.getStatus(), "访问繁忙,请稍后重试");
|
|
|
|
|
|
+ throw BusinessException.builder(SyncErrorEnum.AUTH_FAIL.getStatus(), "服务器访问繁忙,请稍后重试");
|
|
}
|
|
}
|
|
if (httpContentVo.getStatus() != 0 ) {
|
|
if (httpContentVo.getStatus() != 0 ) {
|
|
- throw BusinessException.builder(SyncErrorEnum.FAIL.getStatus(), "同步物联网出错:" + httpContentVo.getMsg());
|
|
|
|
|
|
+ throw BusinessException.builder(SyncErrorEnum.FAIL.getStatus(), "同步物联网出错,code:" + httpContentVo.getStatus() + ",msg:" + httpContentVo.getMsg());
|
|
}
|
|
}
|
|
T t = httpContentVo.getData();
|
|
T t = httpContentVo.getData();
|
|
if (t == null || clazz == null) {
|
|
if (t == null || clazz == null) {
|