mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 10:43:08 +00:00
fix: Improve error handling and state management in auto-mode and utilities
This commit is contained in:
@@ -519,15 +519,22 @@ export class AutoModeServiceFacade {
|
||||
useWorktrees = false,
|
||||
_calledInternally = false
|
||||
): Promise<void> {
|
||||
// Do not call handleFacadeError here: ExecutionService.executeFeature already
|
||||
// classifies and emits auto_mode_error, so calling handleFacadeError would
|
||||
// produce duplicate error events. Simply let the error propagate to the caller.
|
||||
return await this.recoveryService.resumeFeature(
|
||||
this.projectPath,
|
||||
featureId,
|
||||
useWorktrees,
|
||||
_calledInternally
|
||||
);
|
||||
// Note: ExecutionService.executeFeature catches its own errors internally and
|
||||
// does NOT re-throw them (it emits auto_mode_error and returns normally).
|
||||
// Therefore, errors that reach this catch block are pre-execution failures
|
||||
// (e.g., feature not found, context read error) that ExecutionService never
|
||||
// handled — so calling handleFacadeError here does NOT produce duplicate events.
|
||||
try {
|
||||
return await this.recoveryService.resumeFeature(
|
||||
this.projectPath,
|
||||
featureId,
|
||||
useWorktrees,
|
||||
_calledInternally
|
||||
);
|
||||
} catch (error) {
|
||||
this.handleFacadeError(error, 'resumeFeature', featureId);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user