ddnet_account_client/
errors.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
8pub enum HttpLikeError {
9 #[error("The request failed to be sent.")]
11 Request,
12 #[error("The server responsed with status code {0}")]
14 Status(u16),
15 #[error("{0}")]
17 Other(anyhow::Error),
18}
19
20impl From<serde_json::Error> for HttpLikeError {
21 fn from(value: serde_json::Error) -> Self {
22 Self::Other(value.into())
23 }
24}
25
26#[derive(Error, Debug)]
29pub enum FsLikeError {
30 #[error("{0}")]
32 Fs(std::io::Error),
33 #[error("{0}")]
35 Other(anyhow::Error),
36}
37
38impl From<std::io::Error> for FsLikeError {
39 fn from(value: std::io::Error) -> Self {
40 Self::Fs(value)
41 }
42}