From 65dc0c8f2d5526290305546c7e63d7e231be27f6 Mon Sep 17 00:00:00 2001 From: Rishabh Mishra Date: Mon, 28 Oct 2024 15:57:15 +0530 Subject: [PATCH] fix: check for resource.ErrNotExist error in check permission (#808) --- internal/api/v1beta1/permission_check.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/v1beta1/permission_check.go b/internal/api/v1beta1/permission_check.go index 9bdc7d1bd..a2c7cb341 100644 --- a/internal/api/v1beta1/permission_check.go +++ b/internal/api/v1beta1/permission_check.go @@ -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