fix(engine): 🐛 Wrap webhook evalution in try catch
This commit is contained in:
@ -248,9 +248,13 @@ const executeWebhook = async (
|
|||||||
const existingVariable = variables.find(byId(varMapping.variableId))
|
const existingVariable = variables.find(byId(varMapping.variableId))
|
||||||
if (!existingVariable) return newVariables
|
if (!existingVariable) return newVariables
|
||||||
const func = Function('data', `return data.${varMapping?.bodyPath}`)
|
const func = Function('data', `return data.${varMapping?.bodyPath}`)
|
||||||
const value = func(data)
|
try {
|
||||||
updateVariableValue(existingVariable?.id, value)
|
const value = func(data)
|
||||||
return [...newVariables, { ...existingVariable, value }]
|
updateVariableValue(existingVariable?.id, value)
|
||||||
|
return [...newVariables, { ...existingVariable, value }]
|
||||||
|
} catch (err) {
|
||||||
|
return newVariables
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
updateVariables(newVariables)
|
updateVariables(newVariables)
|
||||||
return step.outgoingEdgeId
|
return step.outgoingEdgeId
|
||||||
|
Reference in New Issue
Block a user