add service
Some checks failed
Deploy Smart Search Backend Test / deploy (push) Has been cancelled

This commit is contained in:
vallyenfail
2026-01-19 16:24:33 +03:00
parent 5d52dc4ae2
commit 6d238a96ec
19 changed files with 717 additions and 21 deletions

View File

@@ -11,6 +11,7 @@ const (
InsufficientBalance = "INSUFFICIENT_BALANCE"
UserNotFound = "USER_NOT_FOUND"
RequestNotFound = "REQUEST_NOT_FOUND"
PermissionDenied = "PERMISSION_DENIED"
DatabaseError = "DATABASE_ERROR"
EncryptionError = "ENCRYPTION_ERROR"

View File

@@ -91,6 +91,8 @@ func ToGRPCError(err error, zapLogger *zap.Logger, method string) error {
switch appErr.Code {
case AuthInvalidCredentials, AuthMissing, AuthInvalidToken, RefreshInvalid:
return status.Error(codes.Unauthenticated, appErr.Message)
case PermissionDenied:
return status.Error(codes.PermissionDenied, appErr.Message)
case InviteLimitReached:
return status.Error(codes.ResourceExhausted, appErr.Message)
case InsufficientBalance, InviteInvalidOrExpired: