[−][src]Enum ckb_rpc::RPCError
CKB RPC error codes.
CKB RPC follows the JSON RPC specification about the error object.
Besides the pre-defined errors, all CKB defined errors are listed here.
Here is a reference to the pre-defined errors:
code | message | meaning |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. |
-32600 | Invalid Request | The JSON sent is not a valid Request object. |
-32601 | Method not found | The method does not exist / is not available. |
-32602 | Invalid params | Invalid method parameter(s). |
-32603 | Internal error | Internal JSON-RPC error. |
-32000 to -32099 | Server error | Reserved for implementation-defined server-errors. |
CKB application-defined errors follow some patterns to assign the codes:
- -1 ~ -999 are general errors
- -1000 ~ -2999 are module-specific errors. Each module generally gets 100 reserved error codes.
Unless otherwise noted, all the errors return optional detailed information as string
in the error
object data
field.
Variants
(-1): CKB internal errors are considered to never happen or only happen when the system resources are exhausted.
(-2): The CKB method has been deprecated and disabled.
Set rpc.enable_deprecated_rpc
to true
in the config file to enable all deprecated
methods.
(-3): Error code -3 is no longer used.
Before v0.35.0, CKB returns all RPC errors using the error code -3. CKB no longer uses -3 since v0.35.0.
(-4): The RPC method is not enabled.
CKB groups RPC methods into modules, and a method is enabled only when the module is explicitly enabled in the config file.
(-5): DAO related errors.
(-6): Integer operation overflow.
(-7): The error is caused by a config file option.
Users have to edit the config file to fix the error.
(-101): The CKB local node failed to broadcast a message to its peers.
(-200): Internal database error.
The CKB node persists data to the database. This is the error from the underlying database module.
(-201): The chain index is inconsistent.
An example of an inconsistent index is that the chain index says a block hash is in the chain but the block cannot be read from the database.
This is a fatal error usually due to a serious bug. Please back up the data directory and re-sync the chain from scratch.
(-202): The underlying database is corrupt.
This is a fatal error usually caused by the underlying database used by CKB. Please back up the data directory and re-sync the chain from scratch.
(-301): Failed to resolve the referenced cells and headers used in the transaction, as inputs or dependencies.
(-302): Failed to verify the transaction.
(-1000): Some signatures in the submit alert are invalid.
(-1102): The transaction is rejected by the outputs validator specified by the RPC parameter.
(-1103): Pool rejects some transactions which seem contain invalid VM instructions. See the issue link in the error message for details.
(-1104): The transaction fee rate must be greater than or equal to the config option tx_pool.min_fee_rate
The fee rate is calculated as:
fee / (1000 * tx_serialization_size_in_block_in_bytes)
(-1105): The in-pool ancestors count must be less than or equal to the config option tx_pool.max_ancestors_count
Pool rejects a large package of chained transactions to avoid certain kinds of DoS attacks.
(-1106): The transaction is rejected because the pool has reached its limit.
(-1107): The transaction is already in the pool.
(-1108): The transaction is rejected because it does not make sense in the context.
For example, a cellbase transaction is not allowed in send_transaction
RPC.
Implementations
impl RPCError
[src]
pub fn invalid_params<T: Display>(message: T) -> Error
[src]
pub fn custom<T: Display>(error_code: RPCError, message: T) -> Error
[src]
pub fn custom_with_data<T: Display, F: Debug>(
error_code: RPCError,
message: T,
data: F
) -> Error
[src]
error_code: RPCError,
message: T,
data: F
) -> Error
pub fn custom_with_error<T: Display + Debug>(
error_code: RPCError,
err: T
) -> Error
[src]
error_code: RPCError,
err: T
) -> Error
pub fn from_submit_transaction_reject(reject: &Reject) -> Error
[src]
pub fn downcast_submit_transaction_reject(err: &CKBError) -> Option<&Reject>
[src]
pub fn from_ckb_error(err: CKBError) -> Error
[src]
pub fn from_failure_error(err: Error) -> Error
[src]
pub fn ckb_internal_error<T: Display + Debug>(err: T) -> Error
[src]
pub fn rpc_module_is_disabled(module: &str) -> Error
[src]
pub fn rpc_method_is_deprecated() -> Error
[src]
Trait Implementations
impl Clone for RPCError
[src]
impl Copy for RPCError
[src]
impl Debug for RPCError
[src]
impl PartialEq<RPCError> for RPCError
[src]
impl StructuralPartialEq for RPCError
[src]
Auto Trait Implementations
impl RefUnwindSafe for RPCError
impl Send for RPCError
impl Sync for RPCError
impl Unpin for RPCError
impl UnwindSafe for RPCError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,