diff --git a/central_backend/src/server/custom_error.rs b/central_backend/src/server/custom_error.rs index 1b9d6a6..596accd 100644 --- a/central_backend/src/server/custom_error.rs +++ b/central_backend/src/server/custom_error.rs @@ -3,7 +3,6 @@ use actix_web::body::BoxBody; use actix_web::http::StatusCode; use std::error::Error; use std::fmt::{Display, Formatter}; -use std::io::ErrorKind; use zip::result::ZipError; /// Custom error to ease controller writing @@ -52,7 +51,7 @@ impl From for HttpErr { impl From> for HttpErr { fn from(value: Box) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } @@ -82,43 +81,43 @@ impl From for HttpErr { impl From for HttpErr { fn from(value: actix_web::Error) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: actix::MailboxError) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: actix_identity::error::GetIdentityError) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: actix_identity::error::LoginError) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: openssl::error::ErrorStack) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: ZipError) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } } impl From for HttpErr { fn from(value: walkdir::Error) -> Self { - HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) + HttpErr::Err(std::io::Error::other(value.to_string()).into()) } }