diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limiting-factor" -version = "0.3.0" +version = "0.4.0" authors = [ "Sébastien Santoro ", ] diff --git a/src/api/replies.rs b/src/api/replies.rs --- a/src/api/replies.rs +++ b/src/api/replies.rs @@ -135,6 +135,14 @@ Helper methods to prepare API responses - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +pub fn build_not_found_response() -> Failure { + Failure::from(Status::NotFound) +} + +pub fn build_bad_request_response() -> Failure { + Failure::from(Status::BadRequest) +} + pub fn build_internal_server_error_response(message: &str) -> Failure { warn!(target:"api", "{}", message);