Skip to content

Commit 6b345a8

Browse files
committed
fix: add some logging
1 parent 96e4219 commit 6b345a8

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/dips/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ async-trait.workspace = true
1717
uuid.workspace = true
1818
tokio.workspace = true
1919
indexer-monitor = { path = "../monitor" }
20+
tracing.workspace = true
2021

2122
bytes = { version = "1.10.0", optional = true }
2223
derivative = "2.2.0"

crates/dips/src/ipfs.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use futures::TryStreamExt;
99
use http::Uri;
1010
use ipfs_api_prelude::{IpfsApi, TryFromUri};
1111
use serde::Deserialize;
12+
use tracing;
1213

1314
use crate::DipsError;
1415

@@ -50,10 +51,16 @@ impl IpfsFetcher for IpfsClient {
5051
.map_ok(|chunk| chunk.to_vec())
5152
.try_concat()
5253
.await
53-
.map_err(|e| DipsError::SubgraphManifestUnavailable(format!("{}: {}", file, e)))?;
54+
.map_err(|e| {
55+
tracing::warn!("Failed to fetch subgraph manifest {}: {}", file, e);
56+
DipsError::SubgraphManifestUnavailable(format!("{}: {}", file, e))
57+
})?;
5458

5559
let manifest: GraphManifest = serde_yaml::from_slice(&content)
56-
.map_err(|_| DipsError::InvalidSubgraphManifest(file.to_string()))?;
60+
.map_err(|e| {
61+
tracing::warn!("Failed to parse subgraph manifest {}: {}", file, e);
62+
DipsError::InvalidSubgraphManifest(format!("{}: {}", file, e))
63+
})?;
5764

5865
Ok(manifest)
5966
}

0 commit comments

Comments
 (0)