Skip to content

Commit 2ed5588

Browse files
committed
fixup! Fix if/else logic
1 parent f39cee0 commit 2ed5588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func logNotAuthorizedError(ctx context.Context, logger slog.Logger, err error) e
4545
internalError := new(rbac.UnauthorizedError)
4646
if err != nil && xerrors.As(err, &internalError) {
4747
e := new(topdown.Error)
48-
if xerrors.As(err, &e) || e.Code != topdown.CancelErr {
48+
if xerrors.As(err, &e) || e.Code == topdown.CancelErr {
4949
// For some reason rego changes a cancelled context to a topdown.CancelErr. We
5050
// expect to check for cancelled context errors if the user cancels the request,
5151
// so we should change the error to a context.Canceled error.

0 commit comments

Comments
 (0)