Job Scheduler Modification to trap error causes


I am running several tasks using the Job Scheduler. However sometimes the task will fail. The error reporting tells me the task has failed and moves onto the next task. The fact that it has failed is useful, but naturally I want to know “why” it has failed. Has anyone done any modifications to the Job Scheduler to record or report the actual cause of the error? Is it actually possible to do this?

The only way it’s to redirect the error message to event viewer, but original codeunit has to be changed.
Navision 5, has the a nice function, Get Last error