TASK: 全局异常优化;
This commit is contained in:
@@ -89,13 +89,10 @@ public class PythonService {
|
||||
response = client.newCall(request).execute();
|
||||
} catch (IOException ioException) {
|
||||
log.error("PythonService##generatePrint异常###{}", ExceptionUtil.getThrowableList(ioException));
|
||||
throw new BusinessException("generate.interface.exception");
|
||||
}
|
||||
//去除限流
|
||||
AccessLimitUtils.validateOut("generatePrint");
|
||||
if (Objects.isNull(response)) {
|
||||
log.error("PythonService##generatePrint异常###{}", "response or body is empty!");
|
||||
throw new BusinessException("generate print exception!");
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(response));
|
||||
Boolean result = jsonObject.getBoolean("successful");
|
||||
if (result) {
|
||||
@@ -103,7 +100,7 @@ public class PythonService {
|
||||
}
|
||||
log.info("生成印花失败###{}", jsonObject);
|
||||
//生成失败
|
||||
throw new BusinessException("generate print exception!");
|
||||
throw new BusinessException("generate.interface.exception");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user