diff --git a/Cargo.lock b/Cargo.lock index fe1c63cdd..9f07a3b58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3891,6 +3891,7 @@ dependencies = [ "tokio", "tonic", "tonic-build", + "tracing", "uuid", ] diff --git a/crates/dips/Cargo.toml b/crates/dips/Cargo.toml index b98e850e2..bca1263d7 100644 --- a/crates/dips/Cargo.toml +++ b/crates/dips/Cargo.toml @@ -17,6 +17,7 @@ async-trait.workspace = true uuid.workspace = true tokio.workspace = true indexer-monitor = { path = "../monitor" } +tracing.workspace = true bytes = { version = "1.10.0", optional = true } derivative = "2.2.0" diff --git a/crates/dips/src/ipfs.rs b/crates/dips/src/ipfs.rs index 81d89854c..5fd54141c 100644 --- a/crates/dips/src/ipfs.rs +++ b/crates/dips/src/ipfs.rs @@ -9,6 +9,7 @@ use futures::TryStreamExt; use http::Uri; use ipfs_api_prelude::{IpfsApi, TryFromUri}; use serde::Deserialize; +use tracing; use crate::DipsError; @@ -50,10 +51,15 @@ impl IpfsFetcher for IpfsClient { .map_ok(|chunk| chunk.to_vec()) .try_concat() .await - .unwrap(); - - let manifest: GraphManifest = serde_yaml::from_slice(&content) - .map_err(|_| DipsError::InvalidSubgraphManifest(file.to_string()))?; + .map_err(|e| { + tracing::warn!("Failed to fetch subgraph manifest {}: {}", file, e); + DipsError::SubgraphManifestUnavailable(format!("{}: {}", file, e)) + })?; + + let manifest: GraphManifest = serde_yaml::from_slice(&content).map_err(|e| { + tracing::warn!("Failed to parse subgraph manifest {}: {}", file, e); + DipsError::InvalidSubgraphManifest(format!("{}: {}", file, e)) + })?; Ok(manifest) } diff --git a/crates/dips/src/lib.rs b/crates/dips/src/lib.rs index 0b1af9611..6ad37c5db 100644 --- a/crates/dips/src/lib.rs +++ b/crates/dips/src/lib.rs @@ -139,6 +139,8 @@ pub enum DipsError { PayerNotAuthorised(Address), #[error("voucher payee {actual} does not match the expected address {expected}")] UnexpectedPayee { expected: Address, actual: Address }, + #[error("cannot get subgraph manifest for {0}")] + SubgraphManifestUnavailable(String), #[error("invalid subgraph id {0}")] InvalidSubgraphManifest(String), #[error("voucher for chain id {0}, subgraph manifest has network {1}")]