pub enum ProviderError {
SerdeJsonError(Error),
EncoderError(EncodingError),
CoinsSerError(SerError),
Unsupported(String),
RpcErrorResponse(ErrorResponse),
Custom {
from_parsing: bool,
e: Box<dyn Error>,
},
}Expand description
Errors thrown by providers
Variants§
SerdeJsonError(Error)
Serde issue
EncoderError(EncodingError)
Bubbled up from bitcoins
CoinsSerError(SerError)
Bubbled up from core
Unsupported(String)
Unsupported action. Provider should give a string describing the action and reason
RpcErrorResponse(ErrorResponse)
RPC Error Response
Custom
Custom provider error. Indicates whether the request should be retried
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn custom(from_parsing: bool, e: Box<dyn Error>) -> Self
pub fn custom(from_parsing: bool, e: Box<dyn Error>) -> Self
Shortcut for instantiating a custom error
Sourcepub fn from_parsing(&self) -> bool
pub fn from_parsing(&self) -> bool
Returns true if the request failed due to a local parsing error.
§Note:
This usually indicates that a requested object was not found. It is common for Bitcoin APIs to violate JSON RPC conventions, and return raw strings in this case.
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
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<EncodingError> for ProviderError
impl From<EncodingError> for ProviderError
Source§fn from(source: EncodingError) -> Self
fn from(source: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ProviderError
impl From<Error> for ProviderError
Source§impl From<ErrorResponse> for ProviderError
impl From<ErrorResponse> for ProviderError
Source§fn from(e: ErrorResponse) -> Self
fn from(e: ErrorResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProviderError
impl !RefUnwindSafe for ProviderError
impl !Send for ProviderError
impl !Sync for ProviderError
impl Unpin for ProviderError
impl !UnwindSafe for ProviderError
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