Switch from "impl Responder" to Result<> response
This commit is contained in:
parent
a17a9868fa
commit
09c50411d1
3 changed files with 99 additions and 133 deletions
src/db
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue