diff options
author | HampusM <hampus@hampusmat.com> | 2022-09-06 21:40:01 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-09-06 21:40:01 +0200 |
commit | b44463d533ba9b789e3423d670e2ddcc32c1112c (patch) | |
tree | 68f377f86ffbc99efcd88bc4fa1549784af6cf5d /src/errors | |
parent | d7929e7e9fee879a28871c2195620869db291441 (diff) |
feat: add getting user & playlists
Diffstat (limited to 'src/errors')
-rw-r--r-- | src/errors/client.rs | 28 | ||||
-rw-r--r-- | src/errors/mod.rs | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/errors/client.rs b/src/errors/client.rs new file mode 100644 index 0000000..c3397e3 --- /dev/null +++ b/src/errors/client.rs @@ -0,0 +1,28 @@ +//! 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), + + /// 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, +} diff --git a/src/errors/mod.rs b/src/errors/mod.rs index ea85f4a..ad4da47 100644 --- a/src/errors/mod.rs +++ b/src/errors/mod.rs @@ -1,3 +1,4 @@ //! Error types. pub mod auth; +pub mod client; |