Skip to content

Commit 4357a3c

Browse files
committed
RecordingAuthorizer: AllAsserted: provide more information on missed calls
1 parent add77c6 commit 4357a3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/coderdtest/authorize.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,15 @@ func (*RecordingAuthorizer) Pair(action rbac.Action, object rbac.Objecter) Actio
573573
func (r *RecordingAuthorizer) AllAsserted() error {
574574
r.RLock()
575575
defer r.RUnlock()
576-
missed := 0
576+
missed := []authCall{}
577577
for _, c := range r.Called {
578578
if !c.asserted {
579-
missed++
579+
missed = append(missed, c)
580580
}
581581
}
582582

583-
if missed > 0 {
584-
return xerrors.Errorf("missed %d calls", missed)
583+
if len(missed) > 0 {
584+
return xerrors.Errorf("missed calls: %+v", missed)
585585
}
586586
return nil
587587
}

0 commit comments

Comments
 (0)