geosmart commented on a change in pull request #3563:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/3563#discussion_r474385239
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskInstanceService.java
##########
@@ -93,23 +99,17 @@
}
int[] statusArray = null;
- if(stateType != null){
+ if (stateType != null) {
statusArray = new int[]{stateType.ordinal()};
}
Date start = null;
Date end = null;
- try {
- if(StringUtils.isNotEmpty(startDate)){
- start = DateUtils.getScheduleDate(startDate);
- }
- if(StringUtils.isNotEmpty( endDate)){
- end = DateUtils.getScheduleDate(endDate);
- }
- } catch (Exception e) {
- result.put(Constants.STATUS,
Status.REQUEST_PARAMS_NOT_VALID_ERROR);
- result.put(Constants.MSG,
MessageFormat.format(Status.REQUEST_PARAMS_NOT_VALID_ERROR.getMsg(),
"startDate,endDate"));
- return result;
+ if (StringUtils.isNotEmpty(startDate)) {
+ start = DateUtils.getScheduleDate(startDate);
+ }
+ if (StringUtils.isNotEmpty(endDate)) {
+ end = DateUtils.getScheduleDate(endDate);
Review comment:
thanks for review.
i just use `Status.REQUEST_PARAMS_NOT_VALID_ERROR` to return the error when
date param is not right
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]