From 37b4aa9214247c7871fd7b779d2d17ddf44a37f7 Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Wed, 24 Sep 2025 17:06:50 +0200 Subject: [PATCH] chore: use FailedPrecondition when missing credential Signed-off-by: Marco Nenciarini --- internal/cnpgi/common/errors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/cnpgi/common/errors.go b/internal/cnpgi/common/errors.go index 8f8c218..3fc4fe5 100644 --- a/internal/cnpgi/common/errors.go +++ b/internal/cnpgi/common/errors.go @@ -1,8 +1,6 @@ package common import ( - "fmt" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -15,7 +13,8 @@ var ErrEndOfWALStreamReached = status.Errorf(codes.OutOfRange, "end of WAL reach // the object storage. // This will be fixed by the reconciliation loop in the // operator plugin. -var ErrMissingPermissions = fmt.Errorf("no permission to download the backup credentials, retrying") +var ErrMissingPermissions = status.Errorf(codes.FailedPrecondition, + "no permission to download the backup credentials, retrying") // newWALNotFoundError returns a error that states that a // certain WAL file has not been found. This error is