pub enum InkittError {
RequestError(Error),
ParseError(Error),
AuthenticationFailed,
AuthenticationRequired {
field: String,
context: String,
},
MissingRequiredField {
field: String,
context: String,
},
UserNotFound,
StoryNotFound,
PermissionDeniedNotLoggedIn,
AccessDenied,
ApiError {
code: i64,
error_type: String,
message: String,
},
}Expand description
The primary error type for all operations in the Inkitt crate.
Variants§
RequestError(Error)
An error occurred during a network request (e.g., connection timeout, DNS failure).
ParseError(Error)
An error occurred while parsing the JSON response from the API.
AuthenticationFailed
An authentication attempt failed, likely due to invalid credentials.
AuthenticationRequired
A requested field or endpoint requires authentication, but the client is not logged in.
Fields
MissingRequiredField
A required field was missing from the API response.
Fields
UserNotFound
A specific API error (code 1014) indicating the requested user was not found.
StoryNotFound
A specific API error (code 1017) indicating the requested story was not found.
PermissionDeniedNotLoggedIn
A specific API error (code 1018) indicating permission was denied because the user is not logged in.
AccessDenied
A specific API error (code 1154) indicating access to a resource was denied.
ApiError
A catch-all for any other error returned by the Inkitt API.
Trait Implementations§
Source§impl Debug for InkittError
impl Debug for InkittError
Source§impl Display for InkittError
impl Display for InkittError
Source§impl Error for InkittError
impl Error for InkittError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for InkittError
impl From<Error> for InkittError
Auto Trait Implementations§
impl Freeze for InkittError
impl !RefUnwindSafe for InkittError
impl Send for InkittError
impl Sync for InkittError
impl Unpin for InkittError
impl !UnwindSafe for InkittError
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
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.