mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(workflow-block): revert change bubbling up error for workflow block (#963)
This commit is contained in:
committed by
GitHub
parent
472a22cc94
commit
9f0993ed57
@@ -115,12 +115,6 @@ export class WorkflowBlockHandler implements BlockHandler {
|
||||
duration
|
||||
)
|
||||
|
||||
// If the child workflow failed, throw an error to trigger proper error handling in the parent
|
||||
if ((mappedResult as any).success === false) {
|
||||
const childError = (mappedResult as any).error || 'Unknown error'
|
||||
throw new Error(`Error in child workflow "${childWorkflowName}": ${childError}`)
|
||||
}
|
||||
|
||||
return mappedResult
|
||||
} catch (error: any) {
|
||||
logger.error(`Error executing child workflow ${workflowId}:`, error)
|
||||
@@ -134,15 +128,11 @@ export class WorkflowBlockHandler implements BlockHandler {
|
||||
const workflowMetadata = workflows[workflowId]
|
||||
const childWorkflowName = workflowMetadata?.name || workflowId
|
||||
|
||||
// Enhance error message with child workflow context
|
||||
const originalError = error.message || 'Unknown error'
|
||||
|
||||
// Check if error message already has child workflow context to avoid duplication
|
||||
if (originalError.startsWith('Error in child workflow')) {
|
||||
throw error // Re-throw as-is to avoid duplication
|
||||
}
|
||||
|
||||
throw new Error(`Error in child workflow "${childWorkflowName}": ${originalError}`)
|
||||
return {
|
||||
success: false,
|
||||
error: error?.message || 'Child workflow execution failed',
|
||||
childWorkflowName,
|
||||
} as Record<string, any>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user