Commit 40b79410 by huangfusuper

..

parent 48afde58
...@@ -249,7 +249,9 @@ public class ApiNodeServiceImpl implements ApiNodeService { ...@@ -249,7 +249,9 @@ public class ApiNodeServiceImpl implements ApiNodeService {
public void deleteJavaTask(String jobName) { public void deleteJavaTask(String jobName) {
ValidationUtil.dataNotBank(jobName, "jobName不允许为空!"); ValidationUtil.dataNotBank(jobName, "jobName不允许为空!");
JavaTask javaTask = javaTaskMapper.findByJobName(jobName); JavaTask javaTask = javaTaskMapper.findByJobName(jobName);
ValidationUtil.dataNotNull(javaTask, "没有此任务实例!"); if(javaTask == null){
return;
}
javaTaskMapper.deleteByJobName(jobName); javaTaskMapper.deleteByJobName(jobName);
} }
......
...@@ -6,6 +6,7 @@ import com.byit.enums.TransferResultEnum; ...@@ -6,6 +6,7 @@ import com.byit.enums.TransferResultEnum;
import com.byit.exception.DataValidationException; import com.byit.exception.DataValidationException;
import com.byit.job.exceptions.IException; import com.byit.job.exceptions.IException;
import com.byit.job.utils.MythLogUtils; import com.byit.job.utils.MythLogUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
...@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; ...@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
* @date: 2019/12/25 16:02 * @date: 2019/12/25 16:02
**/ **/
@RestControllerAdvice @RestControllerAdvice
@Slf4j
public class ExceptionHandle { public class ExceptionHandle {
/** /**
* 全局异常捕捉 * 全局异常捕捉
...@@ -30,7 +32,8 @@ public class ExceptionHandle { ...@@ -30,7 +32,8 @@ public class ExceptionHandle {
}else if(e instanceof DataValidationException){ }else if(e instanceof DataValidationException){
return ResponseResult.error(TransferResultEnum.ERROR.getCode(), e.getMessage()); return ResponseResult.error(TransferResultEnum.ERROR.getCode(), e.getMessage());
} }
return ResponseResult.error(MythLogUtils.getMessage(e)); log.error(MythLogUtils.getMessage(e));
return ResponseResult.error("调度中心走神了,请稍后再试~~!");
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment