From eb420261bdba6dac7ea9838dae369f84aab444c1 Mon Sep 17 00:00:00 2001 From: Gert Drapers Date: Tue, 7 Nov 2023 11:45:21 -0600 Subject: [PATCH] fix err handling check-decision (#181) --- pkg/cli/cmd/test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/cli/cmd/test.go b/pkg/cli/cmd/test.go index 55715942..b9658eab 100644 --- a/pkg/cli/cmd/test.go +++ b/pkg/cli/cmd/test.go @@ -361,8 +361,17 @@ func checkDecisionV2(ctx context.Context, c az2.AuthorizerClient, msg *structpb. duration := time.Since(start) + if err != nil { + return &checkResult{ + Outcome: false, + Duration: duration, + Err: err, + Str: checkDecisionStringV2(&req), + } + } + return &checkResult{ - Outcome: resp.Decisions[0].GetIs(), + Outcome: iff(err != nil, false, resp.Decisions[0].GetIs()), Duration: duration, Err: err, Str: checkDecisionStringV2(&req),