2019-04-25 11:29:44 -06:00
|
|
|
use crate::rpc_request;
|
2020-02-20 20:04:53 -07:00
|
|
|
use solana_sdk::{signature::SignerError, transaction::TransactionError};
|
2019-04-25 11:29:44 -06:00
|
|
|
use std::{fmt, io};
|
2020-02-20 20:04:53 -07:00
|
|
|
use thiserror::Error;
|
2019-04-25 11:29:44 -06:00
|
|
|
|
2020-02-20 20:04:53 -07:00
|
|
|
#[derive(Error, Debug)]
|
2019-04-25 11:29:44 -06:00
|
|
|
pub enum ClientError {
|
2020-02-20 20:04:53 -07:00
|
|
|
Io(#[from] io::Error),
|
|
|
|
Reqwest(#[from] reqwest::Error),
|
|
|
|
RpcError(#[from] rpc_request::RpcError),
|
|
|
|
SerdeJson(#[from] serde_json::error::Error),
|
|
|
|
SigningError(#[from] SignerError),
|
|
|
|
TransactionError(#[from] TransactionError),
|
2019-04-25 11:29:44 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for ClientError {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
write!(f, "solana client error")
|
|
|
|
}
|
|
|
|
}
|