Use wildcard match for Error variants without special status codes
This commit is contained in:
@@ -242,9 +242,8 @@ impl dioxus_fullstack::AsStatusCode for Error {
|
|||||||
ErrorType::Database(msg) if *msg == (diesel::result::Error::NotFound).to_string() => {
|
ErrorType::Database(msg) if *msg == (diesel::result::Error::NotFound).to_string() => {
|
||||||
StatusCode::NOT_FOUND
|
StatusCode::NOT_FOUND
|
||||||
}
|
}
|
||||||
ErrorType::Database(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
|
||||||
ErrorType::Error(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
|
||||||
ErrorType::ServerFnError(e) => e.as_status_code(),
|
ErrorType::ServerFnError(e) => e.as_status_code(),
|
||||||
|
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user