pub enum ErrorCode {
Show 15 variants
NotFound,
AlreadyExists,
FailedPrecondition,
PermissionDenied,
InvalidArgument,
Internal,
Unauthenticated,
RateLimited,
Expired,
TooManyAttempts,
InvitationRateLimited,
InvitationAlreadyResolved,
InvitationEmailMismatch,
InvitationAlreadyMember,
InvitationDuplicatePending,
}Expand description
Error code returned by the Raft state machine in LedgerResponse::Error.
Service layers match on this code instead of parsing error message strings. Each variant maps to a specific gRPC status code at the service boundary.
Variants§
NotFound
Entity not found (organization, vault, user, team, etc.).
Maps to NOT_FOUND.
AlreadyExists
Entity already exists (duplicate name, slug collision, etc.).
Maps to ALREADY_EXISTS.
FailedPrecondition
Operation violates a precondition (wrong state, dependency exists, etc.).
Maps to FAILED_PRECONDITION.
PermissionDenied
Caller lacks permission for this operation.
Maps to PERMISSION_DENIED.
InvalidArgument
Invalid input (bad name, missing field, etc.).
Maps to INVALID_ARGUMENT.
Internal
Internal error (storage failure, serialization error, etc.).
Maps to INTERNAL.
Unauthenticated
Authentication failure (invalid token, expired, revoked, bad signature).
Maps to UNAUTHENTICATED.
RateLimited
Rate limit exceeded (too many requests in the time window).
Maps to RESOURCE_EXHAUSTED.
Expired
Resource has expired (verification code, onboarding token, etc.).
Maps to FAILED_PRECONDITION.
TooManyAttempts
Too many failed attempts (code verification, authentication, etc.).
Maps to FAILED_PRECONDITION.
InvitationRateLimited
Invitation rate limit exceeded (per-user, per-org, per-email, or cooldown).
Maps to RESOURCE_EXHAUSTED.
InvitationAlreadyResolved
Invitation is no longer Pending (already accepted, declined, expired, or revoked).
Maps to FAILED_PRECONDITION.
InvitationEmailMismatch
User’s email does not match invitee.
Maps to NOT_FOUND (privacy: avoids confirming invitation existence).
InvitationAlreadyMember
Invitee email belongs to an existing member of the inviting organization.
Maps to ALREADY_EXISTS.
InvitationDuplicatePending
A Pending invitation already exists for this org+email combination.
Maps to ALREADY_EXISTS.