More error refactoring

This commit is contained in:
Alex Auvolat
2022-05-13 15:21:32 +02:00
parent f82b938033
commit 7a5d329e49
12 changed files with 37 additions and 54 deletions
+5
View File
@@ -38,6 +38,11 @@ impl CommonError {
CommonError::BadRequest(_) => StatusCode::BAD_REQUEST,
}
}
pub fn bad_request<M: ToString>(msg: M) -> Self {
CommonError::BadRequest(msg.to_string())
}
}
/// Trait to map error to the Bad Request error code