Skip to content

Commit

Permalink
Merge pull request #134 from egovframe-contribution/sonar_bugFix_01
Browse files Browse the repository at this point in the history
Throwable에서 catch하던 NullPointerException를 분리하여 catch
  • Loading branch information
jei007 committed Nov 3, 2023
2 parents ba876be + fd9d878 commit a9f3497
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,15 @@ public int start(String jobPath, String jobIdentifier, String[] parameters, Set<
LOGGER.warn("jobExecutionTime=" + (jobExecution.getEndTime().getTime() - jobExecution.getStartTime().getTime()) / 1000f + "s");

return exitCodeMapper.intValue(jobExecution.getExitStatus().getExitCode());
} catch (NullPointerException e) {
String message = "Job Terminated in error: " + e.getMessage();
LOGGER.error("["+e.getClass()+"] Try/Catch...NullPointerException : " + e.getMessage());
EgovCommandLineRunner.message = message;
return exitCodeMapper.intValue(ExitStatus.FAILED.getExitCode());
} catch (Throwable e) {
String message = "Job Terminated in error: " + e.getMessage();
//2017.02.15 장동한 시큐어코딩(ES)-부적절한 예외 처리[CWE-253, CWE-440, CWE-754]
LOGGER.error("["+e.getClass()+"] Try/Catch...job tart Runing : " + e.getMessage());
LOGGER.error("["+e.getClass()+"] Try/Catch...job start Running : " + e.getMessage());
EgovCommandLineRunner.message = message;
return exitCodeMapper.intValue(ExitStatus.FAILED.getExitCode());
} finally {
Expand Down Expand Up @@ -398,5 +403,4 @@ private JobParameters getNextJobParameters(Job job) throws JobParametersNotFound
}
return jobParameters;
}

}

0 comments on commit a9f3497

Please sign in to comment.