From 276d1ce60ac726fda49117b3d3f4454e10fe36c7 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 29 Aug 2022 10:05:25 +0200 Subject: [PATCH] feat(backups/Task): add original log to *log after end* error --- @xen-orchestra/backups/Task.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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