imposm3 icon indicating copy to clipboard operation
imposm3 copied to clipboard

display line error for "mapping value '%s' not a string"

Open mayeulk opened this issue 7 years ago • 5 comments

https://github.com/omniscale/imposm3/blob/6528d3e3866a7e6164f6a268feacf95c698aa465/mapping/config/config.go#L102

With an ill-formed yml file, the error message being returned is sometimes as follows: "mapping value '' not a string" This is hard to debug. Adding some context (for instance: what is the key?) or, better, the line number, would help a lot.

mayeulk avatar Sep 17 '18 14:09 mayeulk

Attached a settings/mapping.yml file (from my fork of the docker-osm project) which triggers such error screenshot_20180917_mapping_value_not_a_string

mayeulk avatar Sep 17 '18 15:09 mayeulk

mapping.yml.txt

mayeulk avatar Sep 17 '18 15:09 mayeulk

So far, I think docker-OSM is using a copy from https://github.com/omniscale/imposm3/blob/master/example-mapping.yml

Could you try this one?

Maybe do a git diff after replacement to check if the version in Docker-OSM is more or less the same.

Gustry avatar Sep 17 '18 16:09 Gustry

Thanks Etienne! I managed to create a correct file. THe issue I opened is about the fact that the error message is not informative, and could be improved. For instance, maybe the code could be modified so that the message "mapping value '%s' not a string" would be instead: "mapping value '%s' (tied to mapping key '%t') not a string" This would help a lot when the mapping value is displayed as an empty string in the message.

mayeulk avatar Sep 18 '18 12:09 mayeulk

Yes sure. It's still an issue upstream indeed. I was just trying to help you to overpass the current problem in your file in the meantime ;-)

Gustry avatar Sep 18 '18 12:09 Gustry