pub enum ErrorCode {
Show 17 variants
NotFound,
AlreadyExists,
FailedPrecondition,
PermissionDenied,
InvalidArgument,
Internal,
Unauthenticated,
RateLimited,
Expired,
TooManyAttempts,
InvitationRateLimited,
InvitationAlreadyResolved,
InvitationEmailMismatch,
InvitationAlreadyMember,
InvitationDuplicatePending,
StaleRouting,
Deprecated,
}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.
StaleRouting
Vault routing changed between slug resolution and proposal submission.
Maps to FAILED_PRECONDITION.
Deprecated
RPC, message, or feature is deprecated and the server refuses to handle it.
Used by the per-vault consensus migration to reject cross-vault BatchWrite
requests; clients are expected to issue per-vault Write calls instead.
Maps to FAILED_PRECONDITION.
Implementations§
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request