1pub type Result<T> = std::result::Result<T, Error>;
19
20#[non_exhaustive]
22#[derive(Debug, thiserror::Error)]
23pub enum Error {
24 #[error("Serialization failed: {0}")]
25 Serialization(#[from] serde_json::Error),
26
27 #[error("get result failed: {0}")]
28 ErrResult(String),
29
30 #[error("param:{0} with error_message:{1}")]
31 InvalidParam(String, String),
32
33 #[error("request_id:{0:?} ret_code:{1} error_code:{2} message:{3:?}")]
34 ErrResponse(Option<String>, i32, i32, Option<String>),
35
36 #[cfg(feature = "config")]
38 #[error("config not found: {0}")]
39 ConfigNotFound(String),
40
41 #[cfg(feature = "config")]
43 #[error("config query conflict: {0}")]
44 ConfigQueryConflict(String),
45
46 #[error("remote client shutdown failed: {0}")]
47 ClientShutdown(String),
48
49 #[error("remote client unhealthy failed: {0}")]
50 ClientUnhealthy(String),
51
52 #[error("tonic grpc transport error: {0}")]
53 TonicGrpcTransport(#[from] tonic::transport::Error),
54
55 #[error("tonic grpc status error: {0}")]
56 TonicGrpcStatus(#[from] tonic::Status),
57
58 #[error("grpc request error: {0}")]
59 GrpcBufferRequest(#[from] tower::BoxError),
60
61 #[error("no available server")]
62 NoAvailableServer,
63
64 #[error("Wrong server address: {0}")]
65 WrongServerAddress(String),
66
67 #[deprecated]
68 #[allow(unused)]
69 #[error("Exceeded maximum retry attempts: {0}")]
70 MaxRetriesExceeded(u32),
71}