pub enum RpcError {
Parse(String),
InvalidRequest(&'static str),
MethodNotFound(String),
InvalidParams(&'static str),
InvalidType(&'static str),
NotFound(&'static str),
MethodDisabled(&'static str),
Internal(String),
}Expand description
JSON-RPC 2.0 and Bitcoin Core-compatible RPC errors.
Variants§
Parse(String)
JSON text could not be parsed.
InvalidRequest(&'static str)
Request object is not a valid JSON-RPC call.
MethodNotFound(String)
Method name is not supported.
InvalidParams(&'static str)
Parameters have the wrong shape.
InvalidType(&'static str)
Parameter value has the wrong JSON type.
NotFound(&'static str)
Requested object was not found.
MethodDisabled(&'static str)
A method is intentionally disabled by policy.
Internal(String)
Internal server failure.
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub const PARSE_ERROR: i64 = -32_700
pub const PARSE_ERROR: i64 = -32_700
Standard JSON-RPC parse error code.
Sourcepub const INVALID_REQUEST: i64 = -32_600
pub const INVALID_REQUEST: i64 = -32_600
Standard JSON-RPC invalid request code.
Sourcepub const METHOD_NOT_FOUND: i64 = -32_601
pub const METHOD_NOT_FOUND: i64 = -32_601
Standard JSON-RPC unknown method code.
Sourcepub const INVALID_PARAMS: i64 = -32_602
pub const INVALID_PARAMS: i64 = -32_602
Standard JSON-RPC invalid params code.
Sourcepub const INTERNAL_ERROR: i64 = -32_603
pub const INTERNAL_ERROR: i64 = -32_603
Standard JSON-RPC internal error code.
Sourcepub const CORE_INVALID_TYPE: i64 = -3
pub const CORE_INVALID_TYPE: i64 = -3
Bitcoin Core invalid type code.
Sourcepub const CORE_NOT_FOUND: i64 = -5
pub const CORE_NOT_FOUND: i64 = -5
Bitcoin Core not-found code.
Sourcepub const CORE_INVALID_PARAMETER: i64 = -8
pub const CORE_INVALID_PARAMETER: i64 = -8
Bitcoin Core invalid parameter value code.
Sourcepub const fn method_disabled(message: &'static str) -> Self
pub const fn method_disabled(message: &'static str) -> Self
Builds the no-private-keys policy error used by signing RPCs.
Trait Implementations§
Source§impl Error for RpcError
impl Error for RpcError
1.30.0 · 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()
Source§impl From<HexToBytesError> for RpcError
impl From<HexToBytesError> for RpcError
Source§fn from(_error: HexToBytesError) -> Self
fn from(_error: HexToBytesError) -> Self
Converts to this type from the input type.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more