pub enum Error {
NotAuthenticated,
ExpiredToken,
InvalidStateParameter,
RefreshUnavailable,
NoRemainingPages,
InvalidClientState,
InvalidResponse,
Spotify {
status: u16,
description: String,
},
Authentication {
source: RequestTokenError<Error<Error>, StandardErrorResponse<BasicErrorResponseType>>,
},
Parse {
description: String,
},
Deserialization {
source: Error,
body: String,
},
Http {
source: Error,
},
}
Variants§
NotAuthenticated
The client has not yet been authenticated.
ExpiredToken
The access token has expired and auto-refresh is turned off.
InvalidStateParameter
The (CSRF) state parameter supplied is not the same as the one initially generated and sent to the server.
Learn more about CSRF here.
The access token has expired and refreshing it is not possible in the current authorisation flow.
NoRemainingPages
InvalidClientState
An error that indicates that an internal error occurred and the client had no PKCE verifier when authenticating.
This error should not occur realistically.
InvalidResponse
The returned data is not valid valid UTF-8.
Spotify
An error returned by Spotify.
Fields
Authentication
Fields
Parse
An error related to parsing items.
Deserialization
An error that resulted from deserializing data, either as a model type,
or as a Nil
.
Http
An HTTP error, as returned from the underlying HTTP client.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moreSource§impl From<RequestTokenError<Error<Error>, StandardErrorResponse<BasicErrorResponseType>>> for Error
impl From<RequestTokenError<Error<Error>, StandardErrorResponse<BasicErrorResponseType>>> for Error
Source§fn from(
source: RequestTokenError<Error<Error>, StandardErrorResponse<BasicErrorResponseType>>,
) -> Self
fn from( source: RequestTokenError<Error<Error>, StandardErrorResponse<BasicErrorResponseType>>, ) -> Self
Converts to this type from the input type.
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> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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