Log and display also errors that occur in webhook function

This commit is contained in:
Jan Oberhauser
2019-11-23 21:57:50 +01:00
parent 60241d3163
commit 6e70f16c4b
2 changed files with 63 additions and 13 deletions

View File

@@ -1061,6 +1061,15 @@ export class Workflow {
return null;
}
if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) {
// The node did already fail. So throw an error here that it displays and logs it correctly.
// Does get used by webhook and trigger nodes in case they throw an error that it is possible
// to log the error and display in Editor-UI.
const error = new Error(runExecutionData.resultData.error.message);
error.stack = runExecutionData.resultData.error.stack;
throw error;
}
if (nodeType.executeSingle) {
const returnPromises: Array<Promise<INodeExecutionData>> = [];