diff --git a/src/analytics/enrich_account_funding.rs b/src/analytics/enrich_account_funding.rs index d75522c..702a6b8 100644 --- a/src/analytics/enrich_account_funding.rs +++ b/src/analytics/enrich_account_funding.rs @@ -196,13 +196,25 @@ impl BalanceTracker { let data = self.to_cypher_map(*id)?; let query_literal = generate_cypher_query(data); let query = Query::new(query_literal); - let mut result = pool.execute(query).await?; - - while let Some(r) = result.next().await? { - if let Ok(i) = r.get::("merged_relations") { - trace!("merged ledger in tx: {i}"); - merged_relations += i; - }; + let result = pool.execute(query).await; + + match result { + Ok(mut d) => { + while let r = d.next().await.ok() { + match r { + Ok(row) => { + if let Some(r) = row { + if let Ok(i) = r.get::("merged_relations") { + trace!("merged ledger in tx: {i}"); + merged_relations += i; + }; + } + } + Err(e) => error!("could not parse row in cypher query response: {}", e), + } + } + } + Err(e) => error!("could not get response in cypher query response: {}", e), } } Ok(merged_relations)