#[non_exhaustive]pub enum ErrorCategory {
Show 13 variants
TransientServerFailure,
ContentionOnSharedResources,
DeadlineExceededRequestStateUnknown,
SystemInternalAssumptionViolated,
SecurityAlert,
AuthInterceptorInvalidAuthenticationCredentials,
InsufficientPermission,
InvalidIndependentOfSystemState,
InvalidGivenCurrentSystemStateOther,
InvalidGivenCurrentSystemStateResourceExists,
InvalidGivenCurrentSystemStateResourceMissing,
InvalidGivenCurrentSystemStateSeekAfterEnd,
InternalUnsupportedOperation,
}Expand description
Canton’s error categories — the coarse classification every Ledger API
error carries (ErrorInfo.metadata["category"]), which the error-code
documentation defines retryability on. #[non_exhaustive]: Canton may add
categories.
The variants are the categories of the Canton 3.x docs, by their stable numeric ids (13 is a server-log-only warning that never reaches the API).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TransientServerFailure
1 — a service was momentarily unavailable; the request may or may not have been processed. Retry with backoff.
2 — contention on shared resources (locks, rate limits, a locked contract). Retry with backoff.
DeadlineExceededRequestStateUnknown
3 — the request’s deadline expired with its outcome unknown. Retry a bounded number of times, relying on command deduplication.
SystemInternalAssumptionViolated
4 — a system-internal invariant was violated (implementation bug or data corruption). Not retriable; needs operator/vendor attention.
SecurityAlert
5 — a potential attack or faulty peer was detected; details are deliberately withheld. Not retriable.
AuthInterceptorInvalidAuthenticationCredentials
6 — missing or invalid authentication credentials. Not retriable until the credentials are fixed.
InsufficientPermission
7 — authenticated, but not permitted to perform the operation. Not retriable until permissions change.
InvalidIndependentOfSystemState
8 — the request is invalid regardless of system state (malformed arguments, size limits). Not retriable.
InvalidGivenCurrentSystemStateOther
9 — the current ledger state does not satisfy the request’s preconditions (Daml interpretation failures land here). Not blindly retriable; needs an application-level strategy.
InvalidGivenCurrentSystemStateResourceExists
10 — a referenced resource already exists (e.g. a duplicate command). Not retriable as-is.
InvalidGivenCurrentSystemStateResourceMissing
11 — a referenced resource does not exist (contract, package, party). Not retriable as-is.
InvalidGivenCurrentSystemStateSeekAfterEnd
12 — the request reads past the current ledger end. Retriable: the system may naturally progress to make it valid.
InternalUnsupportedOperation
14 — the operation is not implemented / not enabled on this node. Not retriable.
Implementations§
Source§impl ErrorCategory
impl ErrorCategory
Sourcepub const fn from_i32(id: i32) -> Option<ErrorCategory>
pub const fn from_i32(id: i32) -> Option<ErrorCategory>
The category for Canton’s numeric id, None when unrecognized.
Sourcepub const fn is_retriable(self) -> bool
pub const fn is_retriable(self) -> bool
Whether the error-code documentation classifies this category as retryable (transient failures, contention, unknown-outcome deadlines, and reads past the ledger end).
Trait Implementations§
Source§impl Clone for ErrorCategory
impl Clone for ErrorCategory
Source§fn clone(&self) -> ErrorCategory
fn clone(&self) -> ErrorCategory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ErrorCategory
Source§impl Debug for ErrorCategory
impl Debug for ErrorCategory
impl Eq for ErrorCategory
Source§impl Hash for ErrorCategory
impl Hash for ErrorCategory
Source§impl PartialEq for ErrorCategory
impl PartialEq for ErrorCategory
impl StructuralPartialEq for ErrorCategory
Source§impl TryFrom<i32> for ErrorCategory
The std spelling of ErrorCategory::from_i32, so the category can be
used with generic conversion bounds. The inherent method stays: it is the
documented name and the Option shape matches “unknown id” better than an
error type would.
impl TryFrom<i32> for ErrorCategory
The std spelling of ErrorCategory::from_i32, so the category can be
used with generic conversion bounds. The inherent method stays: it is the
documented name and the Option shape matches “unknown id” better than an
error type would.
Auto Trait Implementations§
impl Freeze for ErrorCategory
impl RefUnwindSafe for ErrorCategory
impl Send for ErrorCategory
impl Sync for ErrorCategory
impl Unpin for ErrorCategory
impl UnsafeUnpin for ErrorCategory
impl UnwindSafe for ErrorCategory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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::RequestSource§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