#[non_exhaustive]pub enum ClawftError {
Retry {
source: Box<dyn Error + Send + Sync>,
attempts: u32,
},
Timeout {
operation: String,
},
Provider {
message: String,
},
RateLimited {
retry_after_ms: u64,
},
ConfigInvalid {
reason: String,
},
PluginLoadFailed {
plugin: String,
},
Io(Error),
Json(Error),
Channel(String),
SecurityViolation {
reason: String,
},
}Expand description
Top-level error type for the clawft framework.
Variants are grouped into recoverable (retry, timeout, rate-limit) and fatal (config, plugin, I/O) categories to guide callers on whether retrying is worthwhile.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Retry
A transient failure that may succeed on retry.
Fields
Timeout
An operation exceeded its deadline.
Provider
A provider returned an error (e.g. bad request, server error).
RateLimited
The provider is throttling requests.
ConfigInvalid
Configuration is malformed or semantically invalid.
PluginLoadFailed
A plugin/extension could not be loaded.
Io(Error)
Underlying I/O error.
Json(Error)
JSON serialization / deserialization error.
Channel(String)
A channel-layer error bubbled up.
SecurityViolation
A security boundary was violated (path traversal, oversized input, etc.)
Trait Implementations§
Source§impl Debug for ClawftError
impl Debug for ClawftError
Source§impl Display for ClawftError
impl Display for ClawftError
Source§impl Error for ClawftError
impl Error for ClawftError
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<Error> for ClawftError
impl From<Error> for ClawftError
Auto Trait Implementations§
impl Freeze for ClawftError
impl !RefUnwindSafe for ClawftError
impl Send for ClawftError
impl Sync for ClawftError
impl Unpin for ClawftError
impl UnsafeUnpin for ClawftError
impl !UnwindSafe for ClawftError
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