diff --git a/@xen-orchestra/backups/Task.js b/@xen-orchestra/backups/Task.js index 554b20ec8..e7403d647 100644 --- a/@xen-orchestra/backups/Task.js +++ b/@xen-orchestra/backups/Task.js @@ -3,8 +3,10 @@ const CancelToken = require('promise-toolbox/CancelToken') const Zone = require('node-zone') -const logAfterEnd = () => { - throw new Error('task has already ended') +const logAfterEnd = log => { + const error = new Error('task has already ended') + error.log = log + throw error } const noop = Function.prototype