MCPcopy Index your code
hub / github.com/simstudioai/sim / finalizeExecutionError

Function finalizeExecutionError

apps/sim/lib/workflows/executor/execution-core.ts:281–311  ·  view source on GitHub ↗
(params: {
  error: unknown
  loggingSession: LoggingSession
  executionId: string
  requestId: string
})

Source from the content-addressed store, hash-verified

279}
280
281async function finalizeExecutionError(params: {
282 error: unknown
283 loggingSession: LoggingSession
284 executionId: string
285 requestId: string
286}): Promise<boolean> {
287 const { error, loggingSession, executionId, requestId } = params
288 const executionResult = hasExecutionResult(error) ? error.executionResult : undefined
289 const { traceSpans } = executionResult ? buildTraceSpans(executionResult) : { traceSpans: [] }
290
291 try {
292 await loggingSession.safeCompleteWithError({
293 endedAt: new Date().toISOString(),
294 totalDurationMs: executionResult?.metadata?.duration || 0,
295 error: {
296 message: getErrorMessage(error, 'Execution failed'),
297 stackTrace: error instanceof Error ? error.stack : undefined,
298 },
299 traceSpans,
300 })
301
302 return loggingSession.hasCompleted()
303 } catch (postExecError) {
304 logger.error(`[${requestId}] Post-execution error logging failed`, {
305 error: postExecError,
306 })
307 return false
308 } finally {
309 await clearExecutionCancellationSafely(executionId, requestId)
310 }
311}
312
313export async function executeWorkflowCore(
314 options: ExecuteWorkflowCoreOptions

Callers 1

executeWorkflowCoreFunction · 0.85

Calls 7

hasExecutionResultFunction · 0.90
buildTraceSpansFunction · 0.90
getErrorMessageFunction · 0.90
safeCompleteWithErrorMethod · 0.80
hasCompletedMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected