pub struct AppError {Show 14 fields
pub ctx: Arc<Context>,
pub id: String,
pub path: String,
pub message: String,
pub detailes: String,
pub request_id: Option<String>,
pub status_code: i32,
pub tr_params: OptionalParams,
pub skip_translation: bool,
pub error: OptionalErr,
pub errors: Option<HashMap<String, String>>,
pub errors_nested: Option<HashMap<String, HashMap<String, String>>>,
pub errors_internal: Option<HashMap<String, AppErrorError>>,
pub errors_nested_internal: Option<HashMap<String, HashMap<String, AppErrorError>>>,
}Fields§
§ctx: Arc<Context>§id: String§path: String§message: String§detailes: String§request_id: Option<String>§status_code: i32§tr_params: OptionalParams§skip_translation: bool§error: OptionalErr§errors: Option<HashMap<String, String>>§errors_nested: Option<HashMap<String, HashMap<String, String>>>§errors_internal: Option<HashMap<String, AppErrorError>>§errors_nested_internal: Option<HashMap<String, HashMap<String, AppErrorError>>>Implementations§
Source§impl AppError
impl AppError
pub fn new( ctx: Arc<Context>, path: impl Into<String>, id: impl Into<String>, id_params: OptionalParams, details: impl Into<String>, status_code: i32, errors: Option<AppErrorErrors>, ) -> Self
pub fn error_string(&self) -> String
pub fn translate(&mut self, tf: Option<TranslateFunc>)
pub fn unwrap(&self) -> Option<&(dyn Error + Send + Sync)>
pub fn wrap(self, err: Box<dyn Error + Send + Sync>) -> Self
pub fn wipe_detailed(&mut self)
pub fn default() -> Self
Sourcepub fn to_proto(&self) -> AppErrorProto
pub fn to_proto(&self) -> AppErrorProto
Convert to proto-generated struct
pub fn to_internal(self, ctx: Arc<Context>, path: String) -> Self
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AppError
impl !RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl !UnwindSafe for AppError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request