CantonError

data class CantonError(val grpcCode: Status.Code, val errorCode: String?, val correlationId: String?, val retryable: Boolean, val retryDelay: Duration?, val description: String)

A decoded Canton Ledger API error.

Canton attaches structured google.rpc error details to failed RPCs: ErrorInfo carries the Canton error code (e.g. CONTRACT_NOT_FOUND, NOT_CONNECTED_TO_ANY_SYNCHRONIZER), RetryInfo marks retryable errors with a server-suggested backoff, and RequestInfo carries the correlation id to quote when filing support requests against a validator operator.

Constructors

Link copied to clipboard
constructor(grpcCode: Status.Code, errorCode: String?, correlationId: String?, retryable: Boolean, retryDelay: Duration?, description: String)

Types

Link copied to clipboard
object Companion

Decoders from the two places a ledger failure arrives: a thrown gRPC status, or a google.rpc.Status inside a completion.

Properties

Link copied to clipboard

Correlation id for tracing the error on the participant, if present.

Link copied to clipboard

Human-readable description from the server.

Link copied to clipboard

Canton's self-service error code from ErrorInfo.reason, if present.

Link copied to clipboard
val grpcCode: Status.Code

The gRPC status code of the failed call.

Link copied to clipboard

Whether the failure is an authentication/authorization rejection — the candidates for a token refresh and reconnect. Live-verified against LocalNet: an expired token is rejected on admission with UNAUTHENTICATED and no RetryInfo; reading for a party this participant doesn't authorize is PERMISSION_DENIED. ACCESS_TOKEN_EXPIRED is Canton's error id for aborting an already-running stream whose token lapsed — enforcement varies by participant configuration (LocalNet 3.5.11 lets idle streams outlive their token; deployments with ongoing auth checks abort them).

Link copied to clipboard

Whether the caller should retry (RetryInfo present, or a transient gRPC code).

Link copied to clipboard

Server-suggested minimum backoff before retrying, if provided.