From 420ed7be0b97949f3835eb0fdcc2131908fd7f6a Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 9 Jun 2022 08:21:57 -0400 Subject: errors: Add NoneResult For when you don't need to return anything but still need to return a ServiceError maybe --- src/errors.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/errors.rs b/src/errors.rs index 06a0233..d76db92 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -7,7 +7,7 @@ use axum::Json; #[derive(Debug, Error)] pub enum ServiceError { - #[error("Waifulib error: {0}")] + #[error("Solarlib error: {0}")] Solarlib(#[from] solarlib::errors::Error), #[error("Axum error: {0}")] @@ -17,6 +17,7 @@ pub enum ServiceError { pub type StringResult = std::result::Result; pub type JsonResult = std::result::Result; +pub type NoneResult = std::result::Result<(), ServiceError>; impl IntoResponse for ServiceError { fn into_response(self) -> Response { -- cgit v1.2.3