pub enum Error {
Internal {
message: String,
},
Request {
message: String,
status: Option<StatusCode>,
url: String,
},
Decode {
message: String,
content: Vec<u8>,
url: String,
},
Authentication {
message: String,
},
Input {
message: String,
},
Block {
message: String,
body: String,
url: String,
},
}
Expand description
Crate specific error types.
Variants§
Internal
Error was caused by something library internal. This only happens if something was implemented incorrectly (which hopefully should never be the case) or if Crunchyroll surprisingly changed specific parts of their api which broke a part of this crate.
Request
Some sort of error occurred while requesting the Crunchyroll api.
Decode
While decoding the api response body something went wrong.
Fields
content: Vec<u8>
The content which failed to get decoded. Might be empty if the error got triggered by
the From<serde_json::Error>
implementation for this enum.
url: String
The url which caused the error. Might be empty if the error got triggered by the
From<serde_json::Error>
implementation for this enum.
Authentication
Something went wrong while logging in.
Input
Generally malformed or invalid user input.
Block
When the request got blocked. Currently this only triggers when the cloudflare bot protection is detected.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.