ic_agent

Enum AgentError

source
pub enum AgentError {
Show 43 variants InvalidReplicaUrl(String), TimeoutWaitingForResponse(), SigningError(String), InvalidCborData(Error), CannotCalculateRequestId(RequestIdError), CandidError(Box<dyn Send + Sync + Error>), UrlParseError(ParseError), InvalidMethodError(InvalidMethod), PrincipalError(PrincipalError), CertifiedReject(RejectResponse), UncertifiedReject(RejectResponse), HttpError(HttpErrorPayload), InvalidReplicaStatus, RequestStatusDoneNoReply(String), MessageError(String), Leb128ReadError(Error), Utf8ReadError(Utf8Error), LookupPathAbsent(Vec<Label>), LookupPathUnknown(Vec<Label>), LookupPathError(Vec<Label>), InvalidRequestStatus(Vec<Label>, String), CertificateVerificationFailed(), QuerySignatureVerificationFailed, CertificateNotAuthorized(), CertificateOutdated(Duration), CertificateHasTooManyDelegations, MissingSignature, MalformedSignature, MalformedPublicKey, TooManySignatures { had: usize, needed: usize, }, DerKeyLengthMismatch { expected: usize, actual: usize, }, DerPrefixMismatch { expected: Vec<u8>, actual: Vec<u8>, }, NoRootKeyInStatus(Status), WalletCallFailed(String), WalletError(String), WalletUpgradeRequired(String), MissingReplicaTransport(), ResponseSizeExceededLimit(), TransportError(Box<dyn Error + Send + Sync>), CallDataMismatch { field: String, value_arg: String, value_cbor: String, }, InvalidRejectCode(InvalidRejectCodeError), RouteProviderError(String), InvalidHttpResponse(String),
}
Expand description

An error that occurred when using the agent.

Variants§

§

InvalidReplicaUrl(String)

The replica URL was invalid.

§

TimeoutWaitingForResponse()

The request timed out.

§

SigningError(String)

An error occurred when signing with the identity.

§

InvalidCborData(Error)

The data fetched was invalid CBOR.

§

CannotCalculateRequestId(RequestIdError)

There was an error calculating a request ID.

§

CandidError(Box<dyn Send + Sync + Error>)

There was an error when de/serializing with Candid.

§

UrlParseError(ParseError)

There was an error parsing a URL.

§

InvalidMethodError(InvalidMethod)

The HTTP method was invalid.

§

PrincipalError(PrincipalError)

The principal string was not a valid principal.

§

CertifiedReject(RejectResponse)

The subnet rejected the message.

§

UncertifiedReject(RejectResponse)

The replica rejected the message. This rejection cannot be verified as authentic.

§

HttpError(HttpErrorPayload)

The replica returned an HTTP error.

§

InvalidReplicaStatus

The status endpoint returned an invalid status.

§

RequestStatusDoneNoReply(String)

The call was marked done, but no reply was provided.

§

MessageError(String)

A string error occurred in an external tool.

§

Leb128ReadError(Error)

There was an error reading a LEB128 value.

§

Utf8ReadError(Utf8Error)

A string was invalid UTF-8.

§

LookupPathAbsent(Vec<Label>)

The lookup path was absent in the certificate.

§

LookupPathUnknown(Vec<Label>)

The lookup path was unknown in the certificate.

§

LookupPathError(Vec<Label>)

The lookup path did not make sense for the certificate.

§

InvalidRequestStatus(Vec<Label>, String)

The request status at the requested path was invalid.

§

CertificateVerificationFailed()

The certificate verification for a read_state call failed.

§

QuerySignatureVerificationFailed

The signature verification for a query call failed.

§

CertificateNotAuthorized()

The certificate contained a delegation that does not include the effective_canister_id in the canister_ranges field.

§

CertificateOutdated(Duration)

The certificate was older than allowed by the ingress_expiry.

§

CertificateHasTooManyDelegations

The certificate contained more than one delegation.

§

MissingSignature

The query response did not contain any node signatures.

§

MalformedSignature

The query response contained a malformed signature.

§

MalformedPublicKey

The read-state response contained a malformed public key.

§

TooManySignatures

The query response contained more node signatures than the subnet has nodes.

Fields

§had: usize

The number of provided signatures.

§needed: usize

The number of nodes on the subnet.

§

DerKeyLengthMismatch

There was a length mismatch between the expected and actual length of the BLS DER-encoded public key.

Fields

§expected: usize

The expected length of the key.

§actual: usize

The actual length of the key.

§

DerPrefixMismatch

There was a mismatch between the expected and actual prefix of the BLS DER-encoded public key.

Fields

§expected: Vec<u8>

The expected key prefix.

§actual: Vec<u8>

The actual key prefix.

§

NoRootKeyInStatus(Status)

The status response did not contain a root key.

§

WalletCallFailed(String)

The invocation to the wallet call forward method failed with an error.

§

WalletError(String)

The wallet operation failed.

§

WalletUpgradeRequired(String)

The wallet canister must be upgraded. See dfx wallet upgrade

§

MissingReplicaTransport()

The transport was not specified in the AgentBuilder.

§

ResponseSizeExceededLimit()

The response size exceeded the provided limit.

§

TransportError(Box<dyn Error + Send + Sync>)

An unknown error occurred during communication with the replica.

§

CallDataMismatch

There was a mismatch between the expected and actual CBOR data during inspection.

Fields

§field: String

The field that was mismatched.

§value_arg: String

The value that was expected to be in the CBOR.

§value_cbor: String

The value that was actually in the CBOR.

§

InvalidRejectCode(InvalidRejectCodeError)

The rejected call had an invalid reject code (valid range 1..5).

§

RouteProviderError(String)

Route provider failed to generate a url for some reason.

§

InvalidHttpResponse(String)

Invalid HTTP response.

Trait Implementations§

source§

impl Debug for AgentError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for AgentError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for AgentError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl From<Error> for AgentError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for AgentError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for AgentError

source§

fn from(e: Error) -> AgentError

Converts to this type from the input type.
source§

impl From<InvalidMethod> for AgentError

source§

fn from(source: InvalidMethod) -> Self

Converts to this type from the input type.
source§

impl From<InvalidRejectCodeError> for AgentError

source§

fn from(source: InvalidRejectCodeError) -> Self

Converts to this type from the input type.
source§

impl From<ParseError> for AgentError

source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
source§

impl From<PrincipalError> for AgentError

source§

fn from(source: PrincipalError) -> Self

Converts to this type from the input type.
source§

impl From<RequestIdError> for AgentError

source§

fn from(source: RequestIdError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for AgentError

source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AgentError

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T