mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-12 04:37:47 +02:00
feat: add skip() function and fuzzy module exclusion support
- Add skip() function to terminate remaining steps in current module while continuing to next module, with optional message parameter - Implement isFuzzyModuleExcluded() for substring-based module filtering in ExecuteFlow - Add fuzzy_exclude_modules CLI flag (-X) to both run and scan commands for flexible module exclusion - Handle ErrSkipModule sentinel error throughout executor (executeStep, executeStepsDAG, ExecuteModule, ExecuteFlow) with proper status propagation - Update function registry and Goja runtime to register skip() function - Add comprehensive unit tests for skip() behavior, SkipModuleError, and fuzzy module matching - Update snapshot tests to use generic example.com instead of shopee.vn
This commit is contained in:
@@ -2,6 +2,7 @@ package executor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -68,6 +69,11 @@ func (e *FunctionExecutor) Execute(ctx context.Context, step *core.Step, execCtx
|
||||
result.Duration = result.EndTime.Sub(result.StartTime)
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, functions.ErrSkipModule) {
|
||||
result.Status = core.StepStatusSkipped
|
||||
result.Error = err
|
||||
return result, err
|
||||
}
|
||||
result.Status = core.StepStatusFailed
|
||||
result.Error = err
|
||||
return result, err
|
||||
|
||||
Reference in New Issue
Block a user