TASK: 全局异常优化;

This commit is contained in:
shahaibo
2023-10-31 14:07:43 +08:00
parent 68d28995b8
commit 44a30bf9b5
40 changed files with 517 additions and 211 deletions

View File

@@ -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");
}
/**