File size: 776 Bytes
d61821a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/functions/concrete/run/runner.go b/functions/concrete/run/runner.go
index 8e50b3c3..d17b3d62 100644
--- a/functions/concrete/run/runner.go
+++ b/functions/concrete/run/runner.go
@@ -335,7 +335,11 @@ func (r *Runner) classifyScriptContextError(jobCtx, scriptCtx context.Context, e
 	switch {
 	case jobErr == nil && errors.Is(scriptCtxErr, context.Canceled):
 		r.logWarningf("Script canceled externally (UI, API)")
-		return &ExitError{Inner: ErrJobCanceled, ExitCode: 1}
+		// Wrap so step-runner's errors.Is(err, context.Canceled) matches.
+		return &ExitError{
+			Inner:    fmt.Errorf("%w: %w", ErrJobCanceled, scriptCtxErr),
+			ExitCode: 1,
+		}
 
 	case !errors.Is(jobErr, context.DeadlineExceeded) &&
 		errors.Is(scriptCtxErr, context.DeadlineExceeded):