Skip to content

Commit

Permalink
✨ Add: ErrorResponse model [#84]
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinrin0413 committed Nov 20, 2024
1 parent 1ce8aae commit 8c9534c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/model/error_response.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! A model for the error response.

use serde::Deserialize;

/// An error response.
#[derive(Clone, Debug, Deserialize)]
#[non_exhaustive]
pub struct ErrorResponse {
/// The error message.
///
/// e.g. "No such user! | Either you mistyped something, or the account no longer exists."
pub msg: Option<String>,
}

impl AsRef<ErrorResponse> for ErrorResponse {
fn as_ref(&self) -> &Self {
self
}
}
1 change: 1 addition & 0 deletions src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub mod achievement;
pub mod achievement_info;
pub mod cache;
pub mod error_response;
pub mod labs;
pub mod leaderboard;
pub mod league_rank;
Expand Down

0 comments on commit 8c9534c

Please sign in to comment.