Commit f443523
committed
Surface the real reason a job execution cannot be restarted
SimpleJobOperator.restart(JobExecution) caught every exception thrown by run(...) and rewrapped it into a JobRestartException with a hardcoded "job execution already running" message. This masked the actual reason reported by the launcher — most notably "Cannot restart job from UNKNOWN status" — sending users down the wrong debugging path.
Catch only JobExecutionAlreadyRunningException for the "already running" message, wrap JobInstanceAlreadyCompleteException and InvalidJobParametersException with their own messages, and let JobRestartException propagate unchanged so its specific message survives.
Resolves #54391 parent 91a81b6 commit f443523
1 file changed
Lines changed: 4 additions & 1 deletion
File tree
- spring-batch-core/src/main/java/org/springframework/batch/core/launch/support
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
| |||
0 commit comments