pub enum SynthError {
Show 13 variants
ConfigError(String),
ValidationError(String),
GenerationError(String),
IoError(Error),
SerializationError(String),
InvalidData(String),
ResourceExhausted(String),
MemoryExhausted {
current_mb: usize,
limit_mb: usize,
},
DiskSpaceExhausted {
available_mb: usize,
required_mb: usize,
},
CpuOverloaded {
load: f64,
threshold: f64,
},
DegradationTriggered {
level: String,
reason: String,
},
ChannelClosed,
NotSupported(String),
}Expand description
Main error type for synthetic data operations.
Variants§
ConfigError(String)
Configuration error
ValidationError(String)
Validation error
GenerationError(String)
Generation error
IoError(Error)
IO error
SerializationError(String)
Serialization error
InvalidData(String)
Invalid data error
ResourceExhausted(String)
Resource exhausted
MemoryExhausted
Memory limit exceeded
DiskSpaceExhausted
Disk space exhausted
CpuOverloaded
CPU overload
DegradationTriggered
Resource degradation triggered
ChannelClosed
Channel closed (for streaming)
NotSupported(String)
Not supported
Implementations§
Source§impl SynthError
impl SynthError
Sourcepub fn validation(msg: impl Into<String>) -> Self
pub fn validation(msg: impl Into<String>) -> Self
Create a validation error.
Sourcepub fn generation(msg: impl Into<String>) -> Self
pub fn generation(msg: impl Into<String>) -> Self
Create a generation error.
Sourcepub fn invalid_data(msg: impl Into<String>) -> Self
pub fn invalid_data(msg: impl Into<String>) -> Self
Create an invalid data error.
Sourcepub fn not_supported(msg: impl Into<String>) -> Self
pub fn not_supported(msg: impl Into<String>) -> Self
Create a not supported error.
Sourcepub fn memory_exhausted(current_mb: usize, limit_mb: usize) -> Self
pub fn memory_exhausted(current_mb: usize, limit_mb: usize) -> Self
Create a memory exhausted error.
Sourcepub fn disk_exhausted(available_mb: usize, required_mb: usize) -> Self
pub fn disk_exhausted(available_mb: usize, required_mb: usize) -> Self
Create a disk space exhausted error.
Sourcepub fn cpu_overloaded(load: f64, threshold: f64) -> Self
pub fn cpu_overloaded(load: f64, threshold: f64) -> Self
Create a CPU overloaded error.
Sourcepub fn degradation(level: impl Into<String>, reason: impl Into<String>) -> Self
pub fn degradation(level: impl Into<String>, reason: impl Into<String>) -> Self
Create a degradation triggered error.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable (degradation or soft limits).
Sourcepub fn is_resource_error(&self) -> bool
pub fn is_resource_error(&self) -> bool
Check if this error is a resource-related error.
Trait Implementations§
Source§impl Debug for SynthError
impl Debug for SynthError
Source§impl Display for SynthError
impl Display for SynthError
Source§impl Error for SynthError
impl Error for SynthError
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 SynthError
impl !RefUnwindSafe for SynthError
impl Send for SynthError
impl Sync for SynthError
impl Unpin for SynthError
impl !UnwindSafe for SynthError
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