pub enum RpcError {
Show 28 variants
Http(Error),
Network {
message: String,
status_code: Option<u16>,
retryable: bool,
},
Timeout(u32),
Json(Error),
InvalidResponse(String),
Rpc {
code: i64,
message: String,
data: Option<Value>,
},
AccountNotFound(AccountId),
InvalidAccount(String),
AccessKeyNotFound {
account_id: AccountId,
public_key: PublicKey,
},
ContractNotDeployed(AccountId),
ContractStateTooLarge(AccountId),
ContractExecution {
contract_id: AccountId,
method_name: Option<String>,
message: String,
},
ContractPanic {
message: String,
},
FunctionCall {
contract_id: AccountId,
method_name: String,
panic: Option<String>,
logs: Vec<String>,
},
UnknownBlock(String),
UnknownChunk(String),
UnknownEpoch(String),
InvalidShardId(String),
UnknownReceipt(String),
InvalidTransaction {
message: String,
details: Option<Value>,
shard_congested: bool,
shard_stuck: bool,
},
InvalidNonce {
tx_nonce: u64,
ak_nonce: u64,
},
InsufficientBalance {
required: String,
available: String,
},
GasLimitExceeded {
gas_used: String,
gas_limit: String,
},
ShardUnavailable(String),
NodeNotSynced(String),
InternalError(String),
ParseError(String),
RequestTimeout {
message: String,
transaction_hash: Option<String>,
},
}Expand description
RPC-specific errors.
Variants§
Http(Error)
Network
Timeout(u32)
Json(Error)
InvalidResponse(String)
Rpc
AccountNotFound(AccountId)
InvalidAccount(String)
AccessKeyNotFound
ContractNotDeployed(AccountId)
ContractStateTooLarge(AccountId)
ContractExecution
ContractPanic
FunctionCall
UnknownBlock(String)
UnknownChunk(String)
UnknownEpoch(String)
InvalidShardId(String)
UnknownReceipt(String)
InvalidTransaction
InvalidNonce
InsufficientBalance
GasLimitExceeded
NodeNotSynced(String)
InternalError(String)
ParseError(String)
RequestTimeout
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable.
Sourcepub fn network(
message: impl Into<String>,
status_code: Option<u16>,
retryable: bool,
) -> Self
pub fn network( message: impl Into<String>, status_code: Option<u16>, retryable: bool, ) -> Self
Create a network error.
Source§impl RpcError
Main error type for near-kit operations.
impl RpcError
Main error type for near-kit operations.
Sourcepub fn is_account_not_found(&self) -> bool
pub fn is_account_not_found(&self) -> bool
Returns true if this error indicates the account was not found.
Sourcepub fn is_contract_not_deployed(&self) -> bool
pub fn is_contract_not_deployed(&self) -> bool
Returns true if this error indicates a contract is not deployed.
Trait Implementations§
Source§impl Error for RpcError
impl Error for RpcError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for RpcError
impl !RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl UnsafeUnpin for RpcError
impl !UnwindSafe for RpcError
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
Mutably borrows from an owned value. Read more
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.