kagkarlsson / db-scheduler

Persistent cluster-friendly scheduler for Java
Apache License 2.0
1.23k stars 188 forks source link

fix: Mention exception in log message on failures #497

Closed runeflobakk closed 3 months ago

runeflobakk commented 3 months ago

Brief, plain english overview of your changes here

A small suggestion for some improved ergonomics when reading log output from db-scheduler in the case of failures.

I always find it effective to include a small "summary" of any caught exception in the actual log message. Often this will allow me to pinpoint the error at hand without needing to look into the stacktrace of the logger event. (But this is still possible of course, as before)

Logs when exceptions propagates all the way back to db-scheduler can typically look like this:

db-scheduler-failure-log

This PR will change the log message to mention the actual exception which was caught in the log message:

Unhandled exception IllegalArgumentException: 'Illegal character in path at index 9: [replace with URL]' during execution of task with name 'my-task-name'. Treating as failure.

Fixes

No existing issue, I suspect. Please consider this PR the issue, with a suggested fix, all bundled nicely together :)

Reminders


cc @kagkarlsson

kagkarlsson commented 3 months ago

🎉 This issue has been resolved in v14.0.1 (Release Notes)