1use crate::model::ip_response::ErrorResponse;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
8pub enum IpApiError {
9 #[error("The supplied ip address is in a reserved range.")]
10 ReservedRange(ErrorResponse),
11 #[error("The supplied ip address is invalid.")]
12 InvalidQuery(ErrorResponse),
13 #[error("An error occurred while parsing the JSON.")]
14 JsonParseError(#[from] serde_json::Error),
15 #[error("An error occurred while querying the API.")]
16 ReqwestError(#[from] reqwest::Error),
17 #[error("An unknown error occurred.")]
18 Unknown(String),
19}