pub struct CallRejected { /* private fields */ }Expand description
Represents an error that occurs when an inter-canister call is rejected.
The reject_code and reject_message
are exposed to provide details of the rejection.
This is wrapped by the CallFailed::CallRejected variant.
Implementations§
Source§impl CallRejected
impl CallRejected
Sourcepub fn with_rejection(raw_reject_code: u32, reject_message: String) -> Self
pub fn with_rejection(raw_reject_code: u32, reject_message: String) -> Self
Constructs a CallRejected instance with the reject code and message.
§Note
This constructor is primarily intended for testing scenarios where you need to simulate rejected inter-canister calls. In production code, instances of this error are typically created by the system when actual rejections occur during inter-canister communication. Use this constructor with caution outside of test environments.
Sourcepub fn reject_code(&self) -> Result<RejectCode, UnrecognizedRejectCode>
pub fn reject_code(&self) -> Result<RejectCode, UnrecognizedRejectCode>
Gets the RejectCode.
The value is converted from api::msg_reject_code.
§Errors
If the raw reject code is not recognized, this method will return an UnrecognizedRejectCode error.
This can happen if the IC produces a new reject code that hasn’t been included in ic_error_types::RejectCode.
Please check if your ic-error-types dependency is up-to-date.
If the latest version of ic-error-types doesn’t include the new reject code, please report it to the ic-cdk maintainers.
Sourcepub fn raw_reject_code(&self) -> u32
pub fn raw_reject_code(&self) -> u32
Gets the raw numeric RejectCode value.
This is a “never-fail” version of reject_code that returns the raw numeric value.
Sourcepub fn reject_message(&self) -> &str
pub fn reject_message(&self) -> &str
Retrieves the reject message associated with the call.
This message is obtained from api::msg_reject_msg.
Trait Implementations§
Source§impl CallErrorExt for CallRejected
impl CallErrorExt for CallRejected
Source§fn is_clean_reject(&self) -> bool
fn is_clean_reject(&self) -> bool
Source§fn is_immediately_retryable(&self) -> bool
fn is_immediately_retryable(&self) -> bool
Source§impl Clone for CallRejected
impl Clone for CallRejected
Source§fn clone(&self) -> CallRejected
fn clone(&self) -> CallRejected
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more