Authored by jack

增加异常捕获日志

... ... @@ -38,8 +38,13 @@ public class AwsToolController {
@RequestMapping(value = "/snapshot/check")
public BaseResponse checkSnapShot(@RequestBody AwsEbsReq task) {
List<M_SnapShot> snapShotList = queryService.querySnapShotList(task.getVolumeId());
List<M_SnapShot> snapShotList = null;
try {
snapShotList = queryService.querySnapShotList(task.getVolumeId());
} catch (Exception e) {
DEBUG.error("Failed to find snapshot info ,error {}", e);
}
BaseResponse response = new BaseResponse();
response.setData(snapShotList);
... ... @@ -55,29 +60,37 @@ public class AwsToolController {
*/
@RequestMapping(value = "/volume/check")
public BaseResponse checkVolume(@RequestBody AwsEbsReq task) {
AwsEbsResp awsEbsTaskResp = new AwsEbsResp();
M_Volume m_volume = queryService.queryVolumeInfo(task.getVolumeId());
try {
M_Volume m_volume = queryService.queryVolumeInfo(task.getVolumeId());
if (null == m_volume) {
return new BaseResponse(400, "未找到相关volume,请确认id...");
}
if (null == m_volume) {
return new BaseResponse(400, "未找到相关volume,请确认id...");
}
String instanceId = m_volume.getInstanceId();
AwsEbsResp awsEbsTaskResp = new AwsEbsResp();
String instanceId = m_volume.getInstanceId();
if (StringUtils.isBlank(instanceId)) {
awsEbsTaskResp.setM_instance(new M_Instance());
if (StringUtils.isBlank(instanceId)) {
awsEbsTaskResp.setM_volume(m_volume);
awsEbsTaskResp.setM_instance(new M_Instance());
} else {
M_Instance m_instance = queryService.queryInstanceInfo(instanceId);
awsEbsTaskResp.setM_volume(m_volume);
awsEbsTaskResp.setM_volume(m_volume);
awsEbsTaskResp.setM_instance(m_instance);
}
} else {
M_Instance m_instance = queryService.queryInstanceInfo(instanceId);
} catch (Exception e) {
awsEbsTaskResp.setM_volume(m_volume);
DEBUG.error("Failed to find volume info ,error {}", e);
awsEbsTaskResp.setM_instance(m_instance);
}
BaseResponse response = new BaseResponse();
... ...