Skip to content

Commit

Permalink
[Fix](Job)Job Task does not display error message
Browse files Browse the repository at this point in the history
Job log should record exception stack and jobid
  • Loading branch information
CalvinKirs committed Sep 26, 2023
1 parent 082bcd8 commit fea35d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onTimerJobTaskHandle(TaskEvent taskEvent) {
jobTask.setIsSuccessful(result.isSuccess());
if (!result.isSuccess()) {
log.warn("Job execute failed, jobId: {}, msg : {}", jobId, result.getExecutorSql());
jobTask.setErrorMsg(result.getExecutorSql());
jobTask.setErrorMsg(result.getErrorMsg());
timerJobManager.pauseJob(jobId);
}
jobTask.setExecuteSql(result.getExecutorSql());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

/**
* we use this executor to execute sql job
*
*/
@Slf4j
public class SqlJobExecutor implements JobExecutor {
Expand Down Expand Up @@ -71,7 +70,7 @@ public ExecutorResult<String> execute(Job job) throws JobException {

return new ExecutorResult<>(result, true, null, sql);
} catch (Exception e) {
log.warn("execute sql job failed, sql: {}, error: {}", sql, e.getMessage());
log.warn("execute sql job failed, job id :{}, sql: {}, error: {}", job.getJobId(), sql, e);
return new ExecutorResult<>(null, false, e.getMessage(), sql);
}

Expand Down

0 comments on commit fea35d6

Please sign in to comment.