2022-08-03 06:19:47 +00:00
|
|
|
use std::fmt;
|
2022-07-12 06:43:07 +00:00
|
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
|
|
pub struct Error {
|
2022-08-03 06:19:47 +00:00
|
|
|
#[prost(int32, tag = "1")]
|
|
|
|
pub code: i32,
|
|
|
|
#[prost(string, optional, tag = "2")]
|
|
|
|
pub message: ::core::option::Option<::prost::alloc::string::String>,
|
|
|
|
#[prost(bytes = "vec", optional, tag = "3")]
|
|
|
|
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl fmt::Display for Error {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
write!(
|
|
|
|
f,
|
|
|
|
"Error code: {}, message: {:?}, data: {:?}",
|
|
|
|
self.code, self.message, self.data
|
|
|
|
) // user-facing output
|
|
|
|
}
|
2022-07-12 06:43:07 +00:00
|
|
|
}
|