pub enum MagiError {
Validation(String),
Provider(ProviderError),
InsufficientAgents {
succeeded: usize,
required: usize,
},
Deserialization(String),
InputTooLarge {
size: usize,
max: usize,
},
InvalidInput {
reason: String,
},
Io(Error),
}Expand description
Unified error type for the magi-core crate.
All public APIs return Result<T, MagiError>. This enum unifies
provider errors, validation failures, and I/O errors into a single type.
Variants§
Validation(String)
Invalid input or schema violation.
Provider(ProviderError)
Wraps a provider-specific error.
InsufficientAgents
Fewer agents completed successfully than the minimum threshold.
Fields
Deserialization(String)
JSON deserialization failure.
InputTooLarge
Content exceeds configured maximum input size.
InvalidInput
Input rejected by invariant check (e.g., prompt nonce collision).
Io(Error)
Filesystem I/O error.
Trait Implementations§
Source§impl Error for MagiError
impl Error for MagiError
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()
Source§impl From<ProviderError> for MagiError
impl From<ProviderError> for MagiError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MagiError
impl !RefUnwindSafe for MagiError
impl Send for MagiError
impl Sync for MagiError
impl Unpin for MagiError
impl UnsafeUnpin for MagiError
impl !UnwindSafe for MagiError
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