Skip to content

Commit

Permalink
fix: check for resource.ErrNotExist error in check permission (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbh authored Oct 28, 2024
1 parent e913c1c commit 65dc0c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/api/v1beta1/permission_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ func handleAuthErr(ctx context.Context, err error) error {
switch {
case errors.Is(err, user.ErrInvalidEmail) || errors.Is(err, errors.ErrUnauthenticated):
return grpcUnauthenticated
case errors.Is(err, organization.ErrNotExist):
return status.Errorf(codes.NotFound, err.Error())
case errors.Is(err, project.ErrNotExist):
case errors.Is(err, organization.ErrNotExist),
errors.Is(err, project.ErrNotExist),
errors.Is(err, resource.ErrNotExist):
return status.Errorf(codes.NotFound, err.Error())
default:
return err
Expand Down

0 comments on commit 65dc0c8

Please sign in to comment.