diff --git a/src/publish.rs b/src/publish.rs index 4a7cde9..334400a 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -498,6 +498,13 @@ async fn get_index_metas( Ok(crate_versions) } +#[derive(Debug, Clone, Deserialize, Eq, PartialEq)] +pub struct PublishWarnings { + pub invalid_categories: Vec, + pub invalid_badges: Vec, + pub other: Vec, +} + async fn process_crates( config: &Config, crate_versions: HashMap>, @@ -570,17 +577,35 @@ async fn process_crates( debug!(status = ?resp.status(), "rcvd server response to publish request"); - let resp_body: serde_json::Value = resp + let warnings: PublishWarnings = resp .error_for_status()? .json() .await?; - debug!("server response body:\n{resp_body:#?}"); + let mut any_warnings = false; + + for warning in warnings.invalid_categories.iter() { + warn!(%crate_name, %version, "registry server invalid category warning: {}", warning); + any_warnings = true; + } + + for warning in warnings.invalid_badges.iter() { + warn!(%crate_name, %version, "registry server invalid badge warning: {}", warning); + any_warnings = true; + } + + for warning in warnings.other.iter() { + warn!(%crate_name, %version, "registry server 'other' warning: {}", warning); + any_warnings = true; + } + + trace!("server response body:\n{warnings:#?}"); info!( %crate_name, %version, - "published crate version", + any_warnings, + "published crate version!", ); } }