Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cel/cel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1160,9 +1160,12 @@ func TestContextEval(t *testing.T) {
if err == nil {
t.Errorf("Got result %v, wanted timeout error", out)
}
if err != nil && err.Error() != "context deadline exceeded" {
if err != nil && !errors.Is(err, context.DeadlineExceeded) {
t.Errorf("Got %v, wanted context deadline exceeded", err)
}
if err != nil && !strings.Contains(err.Error(), "operation interrupted") {
t.Errorf("Got %v, wanted error containing 'operation interrupted'", err)
}
}

func TestContextEvalUnknowns(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cel/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetail
}
out, det, err := p.Eval(vars)
if err != nil && errors.Is(err, interpreter.InterruptError{}) {
return out, det, context.Cause(ctx)
return out, det, fmt.Errorf("%w: %w", err, context.Cause(ctx))
}
return out, det, err
}
Expand Down