diff options
author | Cara Salter <cara@devcara.com> | 2022-07-10 11:05:51 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-07-10 11:05:51 -0400 |
commit | d3279088e3a816db2c254b957159d5b697dc0f62 (patch) | |
tree | 764557ef69bdff984faad4885c8e00d6c9546107 /src/errors.rs | |
parent | 131dd5ab9df295b0bad320675b2307afcbf7d076 (diff) | |
download | homeworld-d3279088e3a816db2c254b957159d5b697dc0f62.tar.gz homeworld-d3279088e3a816db2c254b957159d5b697dc0f62.zip |
colonies: Fully support {meta, user}-data
cloud-init should be able to use this as a seed to properly set up the
Planet.
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index 6b3195f..e513343 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -16,6 +16,9 @@ pub enum ServiceError { #[error("SQL error: {0}")] Sql(#[from] sqlx::Error), + #[error("Generic: {0}")] + Generic(#[from] Box<dyn std::error::Error>), + #[error("Not Found")] NotFound, @@ -23,10 +26,14 @@ pub enum ServiceError { NotAuthorized, } -pub type StringResult<T = &'static str> = Result<T, ServiceError>; +pub type StringResult<T = String> = Result<T, ServiceError>; + +pub type StrResult<T= &'static str> = Result<T, ServiceError>; pub type JsonResult<T> = Result<T, ServiceError>; +pub type NoneResult = Result<(), ServiceError>; + impl IntoResponse for ServiceError { fn into_response(self) -> Response { let body = body::boxed(body::Full::from(self.to_string())); |