diff options
author | Cara Salter <cara@devcara.com> | 2022-06-09 08:21:57 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-06-09 08:21:57 -0400 |
commit | 420ed7be0b97949f3835eb0fdcc2131908fd7f6a (patch) | |
tree | dcaa0ac45503794a5304e7491e46abf3d6e1041b /src | |
parent | 504a2218615f28223bd59577132f6aa06c2dd5fd (diff) | |
download | solard-420ed7be0b97949f3835eb0fdcc2131908fd7f6a.tar.gz solard-420ed7be0b97949f3835eb0fdcc2131908fd7f6a.zip |
errors: Add NoneResult
For when you don't need to return anything but still need to return a
ServiceError maybe
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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<T = &'static str> = std::result::Result<T, ServiceError>; pub type JsonResult<T> = std::result::Result<T, ServiceError>; +pub type NoneResult = std::result::Result<(), ServiceError>; impl IntoResponse for ServiceError { fn into_response(self) -> Response { |