blob: 6eb7e68fc452cbd6f3c19e7c84539069b11740c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
//! Error types for [`DeezerClient`].
use crate::client::DeezerError;
/// Error type for [`DeezerClient`].
#[derive(Debug, thiserror::Error)]
pub enum DeezerClientError
{
/// Failed to send a HTTP request.
#[error("Failed to send HTTP request")]
SendRequestFailed(#[from] hyper::Error),
/// Failed to parse a response from the Deezer API.
#[error("Failed to parse response from the Deezer API")]
ParseResponseFailed(#[from] serde_json::Error),
/// Received a error response from the Deezer API.
#[error("Received a error response from the Deezer API")]
ReceivedErrorResponse(DeezerError),
/// Received a authentication error response from the Deezer.
#[error("Received a authentication error response from the Deezer")]
ReceivedAuthErrorResponse(String),
/// Received a authentication error response from the Deezer that's not valid UTF-8.
#[error(
"Received a authentication error response from the Deezer that's not valid UTF-8"
)]
AuthErrorResponseNotUTF8,
/// Failed to build API endpoint URI.
#[error("Failed to build API endpoint URI")]
BuildAPIEndpointURIFailed,
/// Received a invalid response body from the Deezer API.
#[error("Received a invalid response body from the Deezer API")]
InvalidResponseBody,
}
|