From 98b350418dec01b141ffc5256de28364321d486f Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sun, 24 Oct 2021 12:56:02 -0700 Subject: [PATCH] Log warnings when stripping out broken commands from edits --- map_model/src/edits/perma.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/map_model/src/edits/perma.rs b/map_model/src/edits/perma.rs index 5f74b1ef3d..ba8be06160 100644 --- a/map_model/src/edits/perma.rs +++ b/map_model/src/edits/perma.rs @@ -172,7 +172,7 @@ impl PermanentMapEdits { } /// Transform permanent edits to MapEdits, looking up the map IDs by the hopefully stabler OSM - /// IDs. Strip out commands that're broken. + /// IDs. Strip out commands that're broken, but log warnings. pub fn into_edits_permissive(self, map: &Map) -> MapEdits { let mut edits = MapEdits { edits_name: self.edits_name, @@ -181,7 +181,13 @@ impl PermanentMapEdits { commands: self .commands .into_iter() - .filter_map(|cmd| cmd.into_cmd(map).ok()) + .filter_map(|cmd| match cmd.into_cmd(map) { + Ok(cmd) => Some(cmd), + Err(err) => { + warn!("Skipping broken command: {}", err); + None + } + }) .collect(), merge_zones: self.merge_zones,