public_ip_address/
error.rs1use crate::lookup::error::LookupError;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, Error>;
8
9#[derive(Error, Debug)]
11#[non_exhaustive]
12pub enum Error {
13 #[error("Cache error")]
15 CacheError(#[from] CacheError),
16 #[error("Lookup error")]
18 LookupError(#[from] LookupError),
19 #[error("Time error")]
21 TimeError(#[from] std::time::SystemTimeError),
22}
23
24#[derive(Error, Debug)]
26#[non_exhaustive]
27pub enum CacheError {
28 #[error("Serde error")]
30 SerdeError(#[from] serde_json::Error),
31 #[error("IO error")]
33 IOError(#[from] std::io::Error),
34 #[error("Utf8 error")]
36 Utf8Error(#[from] std::string::FromUtf8Error),
37 #[error("Encryption error")]
39 EncryptionError(String),
40}