Enum rmoods_backend::reddit::error::RedditError
source · pub enum RedditError {
ResourceNotFound(String),
FailedToFetchAccessToken(String),
InvalidDomain(String),
HttpError(Error),
JsonError(Error),
}
Expand description
Represents any kind of error that can occur when dealing with the Reddit API.
Variants§
ResourceNotFound(String)
We request data for a non-existent subreddit or user etc.
FailedToFetchAccessToken(String)
The request that fetches the Reddit access token for our app failed.
InvalidDomain(String)
Invalid domain was given for the request
HttpError(Error)
Some other HTTP error occured.
JsonError(Error)
Deserialization to our structs failed.
Possible causes:
- Our struct definitions are wrong
- We didn’t check for an error status and we’re trying to parse an error response to our structs
- Reddit sent a malformed response (incredibly unlikely)
Trait Implementations§
source§impl Debug for RedditError
impl Debug for RedditError
source§impl Display for RedditError
impl Display for RedditError
source§impl Error for RedditError
impl Error for RedditError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 RedditError
impl From<Error> for RedditError
source§impl From<Error> for RedditError
impl From<Error> for RedditError
source§impl From<RedditError> for AppError
impl From<RedditError> for AppError
source§fn from(value: RedditError) -> Self
fn from(value: RedditError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RedditError
impl !RefUnwindSafe for RedditError
impl Send for RedditError
impl Sync for RedditError
impl Unpin for RedditError
impl !UnwindSafe for RedditError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.