|
@@ -44,19 +44,24 @@ public class HswebResponseJudgeSupport implements ResponseJudgeForProviderDefini
|
|
if (!result.trim().startsWith("{")) {
|
|
if (!result.trim().startsWith("{")) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- JSONObject jsonRes = JSON.parseObject(result);
|
|
|
|
- Integer status = jsonRes.getInteger("status");
|
|
|
|
- if (status == null && response.status() == 200) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- if (status != null) {
|
|
|
|
- if (status == 200) {
|
|
|
|
|
|
+ try {
|
|
|
|
+ JSONObject jsonRes = JSON.parseObject(result);
|
|
|
|
+ if (jsonRes.size() > 5) return null;
|
|
|
|
+ Integer status = jsonRes.getInteger("status");
|
|
|
|
+ if (status == null && response.status() == 200) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- return ErrorType.fromCode(status).orElse(ErrorType.OTHER);
|
|
|
|
- }
|
|
|
|
- if (jsonRes.get("message") != null) {
|
|
|
|
- return ErrorType.valueOf(jsonRes.getString("message"));
|
|
|
|
|
|
+ if (status != null) {
|
|
|
|
+ if (status == 200) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ return ErrorType.fromCode(status).orElse(ErrorType.OTHER);
|
|
|
|
+ }
|
|
|
|
+ if (jsonRes.get("message") != null) {
|
|
|
|
+ return ErrorType.valueOf(jsonRes.getString("message"));
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception ignore) {
|
|
|
|
+
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|