pub struct ErrorManager { /* private fields */ }Expand description
Error manager for collecting, analyzing, and handling training errors
Implementations§
Source§impl ErrorManager
impl ErrorManager
pub fn new() -> Self
Sourcepub fn record_error(&self, error: TrainingError) -> Result<()>
pub fn record_error(&self, error: TrainingError) -> Result<()>
Record a new error
Sourcepub fn create_error(
&self,
error_type: ErrorType,
message: String,
error_code: String,
severity: ErrorSeverity,
context: ErrorContext,
) -> TrainingError
pub fn create_error( &self, error_type: ErrorType, message: String, error_code: String, severity: ErrorSeverity, context: ErrorContext, ) -> TrainingError
Create and record an error with context
Sourcepub fn add_error_pattern(&self, pattern: ErrorPattern) -> Result<()>
pub fn add_error_pattern(&self, pattern: ErrorPattern) -> Result<()>
Add an error pattern for detection
Sourcepub fn add_recovery_strategy(
&self,
error_type: ErrorType,
strategy: RecoveryStrategy,
) -> Result<()>
pub fn add_recovery_strategy( &self, error_type: ErrorType, strategy: RecoveryStrategy, ) -> Result<()>
Add a recovery strategy
Sourcepub fn get_statistics(&self) -> Result<ErrorStatistics>
pub fn get_statistics(&self) -> Result<ErrorStatistics>
Get error statistics
Sourcepub fn get_recent_errors(&self, limit: usize) -> Result<Vec<TrainingError>>
pub fn get_recent_errors(&self, limit: usize) -> Result<Vec<TrainingError>>
Get recent errors
Sourcepub fn clear_errors(&self) -> Result<()>
pub fn clear_errors(&self) -> Result<()>
Clear error history
Sourcepub fn export_errors(&self) -> Result<String>
pub fn export_errors(&self) -> Result<String>
Export errors to JSON for external analysis
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorManager
impl RefUnwindSafe for ErrorManager
impl Send for ErrorManager
impl Sync for ErrorManager
impl Unpin for ErrorManager
impl UnsafeUnpin for ErrorManager
impl UnwindSafe for ErrorManager
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more