Skip to content

Commit

Permalink
added error handling to the GPS bounds extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbeuster authored and dabreegster committed Dec 9, 2024
1 parent 60e5b5b commit 2a7b669
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion streets_reader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ fn extract_osm(
timer,
)?;
// If GPSBounds aren't provided, they'll be computed in the Document
streets.gps_bounds = doc.gps_bounds.clone().unwrap();
// LB 241209 - Added proper error handling due to processing errors, so it doesn't stop processing.
streets.gps_bounds = doc.gps_bounds.clone().ok_or_else(|| {
anyhow::anyhow!("Failed to extract GPS bounds from the OSM input")
})?;

if let Some(pts) = clip_pts {
streets.boundary_polygon =
Expand Down

0 comments on commit 2a7b669

Please sign in to comment.