omniscale/imposm3

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

mayeulk opened this issue · 5 comments

return fmt.Errorf("mapping value '%s' not a string", v)

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.

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

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.

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.

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 ;-)