Skip to content

Commit

Permalink
fix err handling check-decision (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
gertd authored Nov 7, 2023
1 parent d1a62d2 commit eb42026
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/cli/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit eb42026

Please sign in to comment.