(step, error)
| 4482 | } |
| 4483 | |
| 4484 | async function finalizeDeferredStepExecutionError(step, error) { |
| 4485 | const latestState = await getState(); |
| 4486 | const currentStatus = latestState.stepStatuses?.[step]; |
| 4487 | if (currentStatus === 'completed' || currentStatus === 'failed' || currentStatus === 'stopped') { |
| 4488 | return; |
| 4489 | } |
| 4490 | |
| 4491 | if (isStopError(error)) { |
| 4492 | await setStepStatus(step, 'stopped'); |
| 4493 | await addLog(`步骤 ${step} 已被用户停止`, 'warn'); |
| 4494 | await appendManualAccountRunRecordIfNeeded(`step${step}_stopped`, latestState, getErrorMessage(error)); |
| 4495 | return; |
| 4496 | } |
| 4497 | |
| 4498 | await setStepStatus(step, 'failed'); |
| 4499 | await addLog(`步骤 ${step} 失败:${getErrorMessage(error)}`, 'error'); |
| 4500 | await appendManualAccountRunRecordIfNeeded(`step${step}_failed`, latestState, getErrorMessage(error)); |
| 4501 | } |
| 4502 | |
| 4503 | async function executeStepViaCompletionSignal(step, timeoutMs = AUTO_RUN_SIGNAL_COMPLETION_TIMEOUT_MS) { |
| 4504 | const completionResultPromise = waitForStepComplete(step, timeoutMs).then( |
no test coverage detected