pub struct ErrorContext<'a, T = ()> {
pub operation: &'a str,
pub model: Option<&'a str>,
pub request_json: Option<&'a str>,
pub error: &'a Error,
pub state: Option<&'a T>,
}Expand description
Context provided when an error occurs.
This context allows interceptors to observe and react to errors, useful for error tracking and recovery strategies.
Fields§
§operation: &'a strThe operation that failed
model: Option<&'a str>The model being used (if known)
request_json: Option<&'a str>The request body as JSON (if available)
error: &'a ErrorThe error that occurred
state: Option<&'a T>Typed state from the request context (if available)
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ErrorContext<'a, T>
impl<'a, T = ()> !RefUnwindSafe for ErrorContext<'a, T>
impl<'a, T> Send for ErrorContext<'a, T>where
T: Sync,
impl<'a, T> Sync for ErrorContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for ErrorContext<'a, T>
impl<'a, T = ()> !UnwindSafe for ErrorContext<'a, T>
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