Commit b6430a24766871f8cd3ea249a679a16615a6b1bc
1 parent
70c9e61b
http code 200
Showing
1 changed file
with
7 additions
and
0 deletions
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
| @@ -46,6 +46,13 @@ public class GatewayHttpUtils { | @@ -46,6 +46,13 @@ public class GatewayHttpUtils { | ||
| 46 | 46 | ||
| 47 | response = httpClient.execute(post); | 47 | response = httpClient.execute(post); |
| 48 | 48 | ||
| 49 | + int statusCode = response.getStatusLine().getStatusCode(); | ||
| 50 | + if(statusCode != 200){ | ||
| 51 | + post.abort(); | ||
| 52 | + logger.error("http client status code: " + statusCode); | ||
| 53 | + return code; | ||
| 54 | + } | ||
| 55 | + | ||
| 49 | JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); | 56 | JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); |
| 50 | if (null != json && json.getInteger("errCode") == 0) | 57 | if (null != json && json.getInteger("errCode") == 0) |
| 51 | code = 0; | 58 | code = 0; |