From 4b616447715b8129ae322341959e1c2bfabbd10e Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Wed, 20 Jul 2022 10:31:01 -0400 Subject: emails also subnet storage --- src/errors.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 23ad8fa..dcc0ae8 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -19,6 +19,10 @@ pub enum ServiceError { Sql(#[from] sqlx::Error), #[error("Bcrypt: {0}")] Bcrypt(#[from] bcrypt::BcryptError), + #[error("Parse Error: {0}")] + Parse(String), + #[error("Email: {0}")] + Email(String), } pub type StringResult = Result; @@ -37,3 +41,9 @@ impl IntoResponse for ServiceError { Response::builder().status(status).body(body).unwrap() } } + +impl From for ServiceError { + fn from(e: ipnetwork::IpNetworkError) -> Self { + Self::Parse(e.to_string()) + } +} -- cgit v1.2.3