Details
-
Bug
-
Resolution: Fixed
-
Minor
-
17.10.0
-
None
-
Unknown
-
N/A
-
N/A
-
Description
The Scheduler home page (Scheduler.WebHome) displays $xcontext.get('error') in an error box when an action on a job (schedule, pause, resume, unschedule, trigger) fails. However when the job page cannot be loaded (e.g. a database error), the error box is empty and the user doesn't know why the action failed.
The SchedulerPluginApi methods taking an com.xpn.xwiki.api.Object (the ones used by Scheduler.WebHome: scheduleJob, pauseJob, resumeJob, unscheduleJob, triggerJob, getNextFireTime, getPreviousFireTime) catch the exception thrown when retrieving the job and return false/null without putting its message in the error context key, with the comment "we don't need to push the exception message in the context here as it should already have been pushed by the throwing exception". But SchedulerPluginApi#retrieveBaseObject(), which throws it, never pushes it.
Verified with a unit test making the loading of the job page fail: scheduleJob(Object) returns false and $xcontext.get('error') is null.