Skip to content

Commit 0bf58bf

Browse files
committed
added debug logging
1 parent bd20bfa commit 0bf58bf

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

crates/client/src/api.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,23 @@ impl Client {
230230

231231
let res = self.client.get(url).send().await?;
232232

233-
if res.status().is_success() {
234-
if let Some(warg_url) = res
235-
.json::<WellKnownConfig>()
236-
.await
237-
.map_err(|_| {
238-
ClientError::InvalidWellKnownConfig(self.url.registry_domain().to_string())
239-
})?
240-
.warg_url
241-
{
242-
Ok(Some(RegistryUrl::new(warg_url)?))
243-
} else {
244-
Ok(None)
245-
}
233+
if !res.status().is_success() {
234+
tracing::debug!("the `.well-known` config was not found");
235+
return Ok(None);
236+
}
237+
238+
if let Some(warg_url) = res
239+
.json::<WellKnownConfig>()
240+
.await
241+
.map_err(|e| {
242+
tracing::debug!("parsing `.well-known` config failed: {e}");
243+
ClientError::InvalidWellKnownConfig(self.url.registry_domain().to_string())
244+
})?
245+
.warg_url
246+
{
247+
Ok(Some(RegistryUrl::new(warg_url)?))
246248
} else {
249+
tracing::debug!("the `.well-known` config did not have a `wargUrl` set");
247250
Ok(None)
248251
}
249252
}

0 commit comments

Comments
 (0)