fix: say which error it was when failing on serving

This commit is contained in:
əlemi 2023-10-19 05:35:19 +02:00
parent 84467f0141
commit f859314548

View file

@ -33,6 +33,11 @@ async fn route_crawl_domain(
) -> Json<(Vec<ChartVertex>, Vec<ChartArc>)> { ) -> Json<(Vec<ChartVertex>, Vec<ChartArc>)> {
tracing::info!("starting new crawl from {}", params.domain); tracing::info!("starting new crawl from {}", params.domain);
let mut chart = BubbleChart::new(db.clone()); let mut chart = BubbleChart::new(db.clone());
chart.chart_local_bubble(&params.domain).await.expect("wtf could not chart this"); match chart.chart_local_bubble(&params.domain).await {
Json((chart.vertices.values().into_iter().cloned().collect(), chart.arcs)) Ok(()) => Json((chart.vertices.values().into_iter().cloned().collect(), chart.arcs)),
Err(e) => {
tracing::error!("could not chart requested domain: {}", e);
Json((Vec::new(), Vec::new()))
}
}
} }