Use wildcard match for Error variants without special status codes

This commit is contained in:
2026-06-27 15:17:02 -04:00
parent ef9f88e72c
commit 674b58e290

View File

@@ -242,9 +242,8 @@ impl dioxus_fullstack::AsStatusCode for Error {
ErrorType::Database(msg) if *msg == (diesel::result::Error::NotFound).to_string() => {
StatusCode::NOT_FOUND
}
ErrorType::Database(_) => StatusCode::INTERNAL_SERVER_ERROR,
ErrorType::Error(_) => StatusCode::INTERNAL_SERVER_ERROR,
ErrorType::ServerFnError(e) => e.as_status_code(),
_ => StatusCode::INTERNAL_SERVER_ERROR,
}
}
}