Skip to content

Commit 9762bba

Browse files
author
Theodore Li
committed
Distinguish errors from 5xxs
1 parent 6caa79b commit 9762bba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ export async function executeWorkflowWithFullLogging(
492492
if (!response.ok) {
493493
const error = await response.json()
494494
const errorMessage = error.error || 'Workflow execution failed'
495+
const isValidationError = response.status >= 400 && response.status < 500
495496
const now = new Date().toISOString()
496497
addConsole({
497498
input: {},
@@ -503,10 +504,10 @@ export async function executeWorkflowWithFullLogging(
503504
executionOrder: 0,
504505
endedAt: now,
505506
workflowId: wfId,
506-
blockId: 'execution-error',
507+
blockId: isValidationError ? 'validation' : 'execution-error',
507508
executionId,
508-
blockName: 'Execution Error',
509-
blockType: 'error',
509+
blockName: isValidationError ? 'Workflow Validation' : 'Execution Error',
510+
blockType: isValidationError ? 'validation' : 'error',
510511
})
511512
throw new Error(errorMessage)
512513
}

0 commit comments

Comments
 (0)