fix(automation): stop automation when step fails instead of continuing
This commit is contained in:
@@ -64,8 +64,18 @@ export class MockAutomationEngineAdapter implements IAutomationEngine {
|
||||
// Use real workflow automation with IRacingSelectorMap
|
||||
const result = await this.browserAutomation.executeStep(currentStep, config as Record<string, unknown>);
|
||||
if (!result.success) {
|
||||
console.error(`Step ${currentStep.value} (${getStepName(currentStep.value)}) failed:`, result.error);
|
||||
// Continue anyway for now - in production we might want to pause or retry
|
||||
const errorMessage = `Step ${currentStep.value} (${getStepName(currentStep.value)}) failed: ${result.error}`;
|
||||
console.error(errorMessage);
|
||||
|
||||
// Stop automation and mark session as failed
|
||||
if (this.automationInterval) {
|
||||
clearInterval(this.automationInterval);
|
||||
this.automationInterval = null;
|
||||
}
|
||||
|
||||
session.fail(errorMessage);
|
||||
await this.sessionRepository.update(session);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Fallback for adapters without executeStep (e.g., MockBrowserAutomationAdapter)
|
||||
|
||||
Reference in New Issue
Block a user