avail_rust_client/
error.rs

1#[derive(Debug)]
2#[repr(u8)]
3pub enum ClientError {
4	#[cfg(feature = "subxt")]
5	Subxt(crate::subxt::Error) = 0,
6	Core(avail_rust_core::Error) = 1,
7	Custom(String) = 2,
8}
9
10impl From<avail_rust_core::Error> for ClientError {
11	fn from(value: avail_rust_core::Error) -> Self {
12		Self::Core(value)
13	}
14}
15
16impl From<String> for ClientError {
17	fn from(value: String) -> Self {
18		Self::Custom(value)
19	}
20}
21
22impl From<&str> for ClientError {
23	fn from(value: &str) -> Self {
24		Self::Custom(String::from(value))
25	}
26}
27
28#[cfg(feature = "subxt")]
29impl From<crate::subxt::Error> for ClientError {
30	fn from(value: crate::subxt::Error) -> Self {
31		Self::Subxt(value)
32	}
33}