Commit 3c975a61 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Grunt tests ok.

parent d2f90746
...@@ -835,18 +835,27 @@ var JIO = ...@@ -835,18 +835,27 @@ var JIO =
priv.res.status = 'fail'; priv.res.status = 'fail';
priv.res.message = 'Job Stopped!'; priv.res.message = 'Job Stopped!';
priv.res.errno = 0; priv.res.error = {};
priv.res.error.status = 0;
priv.res.error.statusText = 'Replaced';
priv.res.error.message = 'The job was replaced by a newer one.';
priv['fail_'+priv.job.method](); priv['fail_'+priv.job.method]();
priv.callback(priv.res); priv.callback(priv.res);
}; };
that.fail = function ( message, errno ) { that.fail = function ( errorobject ) {
// Called when a job has failed. // Called when a job has failed.
// It will retry the job from a certain moment or it will return // It will retry the job from a certain moment or it will return
// a failure. // a failure.
priv.res.status = 'fail'; priv.res.status = 'fail';
priv.res.message = message; priv.res.error = errorobject;
priv.res.errno = errno; // init error object with default values
priv.res.error.status = priv.res.error.status || 0;
priv.res.error.statusText =
priv.res.error.statusText || 'Unknown Error';
priv.res.error.array = priv.res.error.array || [];
priv.res.error.message = priv.res.error.message || '';
// retry ?
if (!priv.job.maxtries || if (!priv.job.maxtries ||
priv.job.tries < priv.job.maxtries) { priv.job.tries < priv.job.maxtries) {
priv.retryLater(); priv.retryLater();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment