pub enum ApiError {
RequestFailed(Error),
MoltbookError(String, String),
RateLimited(String),
NewAgentRestricted(String),
CaptchaRequired(String),
ParseError(Error),
ConfigError(String),
IoError(Error),
}Expand description
Errors that can occur when interacting with the Moltbook API or local configuration.
Variants§
RequestFailed(Error)
Failure during an HTTP request (e.g., network issues).
MoltbookError(String, String)
A specific error returned by the Moltbook API. Contains an error message and a hint for the user.
RateLimited(String)
The agent has reached a rate limit on the API.
NewAgentRestricted(String)
Specific restriction applied to new agents (e.g., must wait before posting).
CaptchaRequired(String)
A CAPTCHA challenge is required to complete the operation.
ParseError(Error)
Failure to parse the JSON response from the API.
ConfigError(String)
An error related to the local configuration system.
IoError(Error)
A standard IO error (e.g., file permissions, disk space).
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
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 ApiError
impl !RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl !UnwindSafe for ApiError
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.