Switch from "impl Responder" to Result<> response

This commit is contained in:
Tobias Reisinger 2023-11-21 15:30:30 +01:00
parent a17a9868fa
commit 09c50411d1
3 changed files with 99 additions and 133 deletions
src/db

View file

@ -16,7 +16,7 @@ pub enum DatabaseError {
}
impl DatabaseError {
fn get_code(&self) -> StatusCode {
pub fn get_code(&self) -> StatusCode {
match self {
DatabaseError::NotFound => StatusCode::NOT_FOUND,
DatabaseError::Protected => StatusCode::FORBIDDEN,