Browse Source

返回具体错误code

dev_shibei_match
jianjun 5 years ago
parent
commit
a9b32ed7fc
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -29,7 +29,6 @@ import org.springframework.util.CollectionUtils;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
@ -190,7 +189,8 @@ public class HttpClientManager {
String result = EntityUtils.toString(response.getEntity());
return new Result<String>().ok(result);
} else {
log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode());
log.warn("execute http method fail,httpStatus:{}", response.getStatusLine().getStatusCode());
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(),"请求失败httpStatus:"+response.getStatusLine().getStatusCode());
}
}
} catch (Exception e) {

Loading…
Cancel
Save