Skip to content

Commit 4dcc5ed

Browse files
author
Theodore Li
committed
Fix lint
1 parent 5751bc2 commit 4dcc5ed

File tree

2 files changed

+62
-59
lines changed

2 files changed

+62
-59
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
} from '@/lib/workflows/triggers/triggers'
1717
import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-current-workflow'
1818
import {
19-
type BlockEventHandlerConfig,
2019
addHttpErrorConsoleEntry,
21-
addExecutionErrorConsoleEntry as sharedAddExecutionErrorConsoleEntry,
20+
type BlockEventHandlerConfig,
2221
createBlockEventHandlers,
22+
addExecutionErrorConsoleEntry as sharedAddExecutionErrorConsoleEntry,
2323
handleExecutionCancelledConsole as sharedHandleExecutionCancelledConsole,
2424
handleExecutionErrorConsole as sharedHandleExecutionErrorConsole,
2525
} from '@/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils'
@@ -1229,9 +1229,8 @@ export function useWorkflowExecution() {
12291229
} else {
12301230
if (!executor) {
12311231
try {
1232-
const httpStatus = isRecord(error) && typeof error.httpStatus === 'number'
1233-
? error.httpStatus
1234-
: undefined
1232+
const httpStatus =
1233+
isRecord(error) && typeof error.httpStatus === 'number' ? error.httpStatus : undefined
12351234
const storeAddConsole = useTerminalConsoleStore.getState().addConsole
12361235

12371236
if (httpStatus && activeWorkflowId) {

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

Lines changed: 58 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -674,61 +674,65 @@ export async function executeWorkflowWithFullLogging(
674674
}
675675

676676
try {
677-
await processSSEStream(response.body.getReader(), {
678-
onExecutionStarted: (data) => {
679-
logger.info('Execution started', { startTime: data.startTime })
680-
},
681-
682-
onBlockStarted: blockHandlers.onBlockStarted,
683-
onBlockCompleted: blockHandlers.onBlockCompleted,
684-
onBlockError: blockHandlers.onBlockError,
685-
onBlockChildWorkflowStarted: blockHandlers.onBlockChildWorkflowStarted,
686-
687-
onExecutionCompleted: (data) => {
688-
setCurrentExecutionId(wfId, null)
689-
executionResult = {
690-
success: data.success,
691-
output: data.output,
692-
logs: accumulatedBlockLogs,
693-
metadata: {
694-
duration: data.duration,
695-
startTime: data.startTime,
696-
endTime: data.endTime,
697-
},
698-
}
699-
},
700-
701-
onExecutionCancelled: () => {
702-
setCurrentExecutionId(wfId, null)
703-
executionResult = {
704-
success: false,
705-
output: {},
706-
error: 'Execution was cancelled',
707-
logs: accumulatedBlockLogs,
708-
}
709-
},
710-
711-
onExecutionError: (data) => {
712-
setCurrentExecutionId(wfId, null)
713-
const errorMessage = data.error || 'Execution failed'
714-
executionResult = {
715-
success: false,
716-
output: {},
717-
error: errorMessage,
718-
logs: accumulatedBlockLogs,
719-
metadata: { duration: data.duration },
720-
}
721-
722-
handleExecutionErrorConsole(addConsole, cancelRunningEntries, {
723-
workflowId: wfId,
724-
executionId: executionIdRef.current,
725-
error: errorMessage,
726-
durationMs: data.duration || 0,
727-
blockLogs: accumulatedBlockLogs,
728-
isPreExecutionError: accumulatedBlockLogs.length === 0,
729-
})
677+
await processSSEStream(
678+
response.body.getReader(),
679+
{
680+
onExecutionStarted: (data) => {
681+
logger.info('Execution started', { startTime: data.startTime })
682+
},
683+
684+
onBlockStarted: blockHandlers.onBlockStarted,
685+
onBlockCompleted: blockHandlers.onBlockCompleted,
686+
onBlockError: blockHandlers.onBlockError,
687+
onBlockChildWorkflowStarted: blockHandlers.onBlockChildWorkflowStarted,
688+
689+
onExecutionCompleted: (data) => {
690+
setCurrentExecutionId(wfId, null)
691+
executionResult = {
692+
success: data.success,
693+
output: data.output,
694+
logs: accumulatedBlockLogs,
695+
metadata: {
696+
duration: data.duration,
697+
startTime: data.startTime,
698+
endTime: data.endTime,
699+
},
700+
}
701+
},
702+
703+
onExecutionCancelled: () => {
704+
setCurrentExecutionId(wfId, null)
705+
executionResult = {
706+
success: false,
707+
output: {},
708+
error: 'Execution was cancelled',
709+
logs: accumulatedBlockLogs,
710+
}
711+
},
712+
713+
onExecutionError: (data) => {
714+
setCurrentExecutionId(wfId, null)
715+
const errorMessage = data.error || 'Execution failed'
716+
executionResult = {
717+
success: false,
718+
output: {},
719+
error: errorMessage,
720+
logs: accumulatedBlockLogs,
721+
metadata: { duration: data.duration },
722+
}
723+
724+
handleExecutionErrorConsole(addConsole, cancelRunningEntries, {
725+
workflowId: wfId,
726+
executionId: executionIdRef.current,
727+
error: errorMessage,
728+
durationMs: data.duration || 0,
729+
blockLogs: accumulatedBlockLogs,
730+
isPreExecutionError: accumulatedBlockLogs.length === 0,
731+
})
732+
},
730733
},
731-
}, 'CopilotExecution')
734+
'CopilotExecution'
735+
)
732736
} finally {
733737
setCurrentExecutionId(wfId, null)
734738
setActiveBlocks(wfId, new Set())

0 commit comments

Comments
 (0)