mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
refactor(core): Convey error stack from job failure to main (#11261)
This commit is contained in:
parent
76ab780cdd
commit
190665d8e6
|
@ -114,6 +114,7 @@ export class ScalingService {
|
||||||
executionId,
|
executionId,
|
||||||
workerId: this.instanceSettings.hostId,
|
workerId: this.instanceSettings.hostId,
|
||||||
errorMsg: error.message,
|
errorMsg: error.message,
|
||||||
|
errorStack: error.stack ?? '',
|
||||||
};
|
};
|
||||||
|
|
||||||
await job.progress(msg);
|
await job.progress(msg);
|
||||||
|
@ -295,12 +296,18 @@ export class ScalingService {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'job-failed':
|
case 'job-failed':
|
||||||
this.logger.error(`Execution ${msg.executionId} (job ${jobId}) failed`, {
|
this.logger.error(
|
||||||
|
[
|
||||||
|
`Execution ${msg.executionId} (job ${jobId}) failed`,
|
||||||
|
msg.errorStack ? `\n${msg.errorStack}\n` : '',
|
||||||
|
].join(''),
|
||||||
|
{
|
||||||
workerId: msg.workerId,
|
workerId: msg.workerId,
|
||||||
errorMsg: msg.errorMsg,
|
errorMsg: msg.errorMsg,
|
||||||
executionId: msg.executionId,
|
executionId: msg.executionId,
|
||||||
jobId,
|
jobId,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'abort-job':
|
case 'abort-job':
|
||||||
break; // only for worker
|
break; // only for worker
|
||||||
|
|
|
@ -56,6 +56,7 @@ export type JobFailedMessage = {
|
||||||
executionId: string;
|
executionId: string;
|
||||||
workerId: string;
|
workerId: string;
|
||||||
errorMsg: string;
|
errorMsg: string;
|
||||||
|
errorStack: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Message sent by main to worker to abort a job. */
|
/** Message sent by main to worker to abort a job. */
|
||||||
|
|
Loading…
Reference in a new issue