2019-04-25 10:29:44 -07:00
|
|
|
use crate::rpc_request;
|
2020-02-20 19:04:53 -08:00
|
|
|
use solana_sdk::{signature::SignerError, transaction::TransactionError};
|
2019-04-25 10:29:44 -07:00
|
|
|
use std::{fmt, io};
|
2020-02-20 19:04:53 -08:00
|
|
|
use thiserror::Error;
|
2019-04-25 10:29:44 -07:00
|
|
|
|
2020-02-20 19:04:53 -08:00
|
|
|
#[derive(Error, Debug)]
|
2019-04-25 10:29:44 -07:00
|
|
|
pub enum ClientError {
|
2020-02-20 19:04:53 -08: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 10:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for ClientError {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
write!(f, "solana client error")
|
|
|
|
}
|
|
|
|
}
|