Data Observatory: add more logging for coingecko API failures

This commit is contained in:
Mark Sinclair
2026-02-20 14:38:59 +00:00
parent 1678fb6b94
commit ed3956946c
3 changed files with 12 additions and 6 deletions
Generated
+1 -1
View File
@@ -6209,7 +6209,7 @@ dependencies = [
[[package]]
name = "nym-data-observatory"
version = "1.0.2"
version = "1.0.3"
dependencies = [
"anyhow",
"async-trait",
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-data-observatory"
version = "1.0.2"
version = "1.0.3"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
+10 -4
View File
@@ -29,10 +29,16 @@ impl PriceScraper {
async fn get_coingecko_prices(&self) -> anyhow::Result<CoingeckoPriceResponse> {
tracing::info!("💰 Fetching CoinGecko prices from {COINGECKO_API_URL}");
let response = reqwest::get(COINGECKO_API_URL)
.await?
.json::<CoingeckoPriceResponse>()
.await;
let response = reqwest::get(COINGECKO_API_URL).await?;
if !response.status().is_success() {
tracing::error!(
"CoinGecko price query returned error: {}",
response.status()
);
}
let response = response.json::<CoingeckoPriceResponse>().await;
tracing::info!("Got response {:?}", response);
match response {