fix: return error in logs

This commit is contained in:
Emir Karabeg
2025-04-16 05:18:38 -07:00
parent 5075b0922a
commit d1d3c1eeaf
+16
View File
@@ -797,6 +797,22 @@ export class Executor {
blockLog.durationMs =
new Date(blockLog.endedAt).getTime() - new Date(blockLog.startedAt).getTime()
// Log the error even if we'll continue execution through error path
context.blockLogs.push(blockLog)
addConsole({
output: {},
error:
error.message ||
`Error executing ${block.metadata?.id || 'unknown'} block: ${String(error)}`,
durationMs: blockLog.durationMs,
startedAt: blockLog.startedAt,
endedAt: blockLog.endedAt,
workflowId: context.workflowId,
timestamp: blockLog.startedAt,
blockName: block.metadata?.name || 'Unnamed Block',
blockType: block.metadata?.id || 'unknown',
})
// Check for error connections and follow them if they exist
const hasErrorPath = this.activateErrorPath(blockId, context)