use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; pub type Result = core::result::Result; #[derive(Debug)] pub enum Error { LoginFail, PropertyDeleteFailIdNotFound { id: u64 }, } /// FIXME: return different status codes for different errors impl IntoResponse for Error { fn into_response(self) -> Response { println!("->> {:<12} - {self:?}", "INTO_RESPONSE"); (StatusCode::INTERNAL_SERVER_ERROR, "UNHANDLED_CLIENT_ERROR").into_response() } }