diff --git a/src/load_map.cpp b/src/load_map.cpp index 9c1d0358a..7575cf50d 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -545,11 +545,25 @@ void map_parser::parse_style(Map & map, xml_node const& node) if (!map.insert_style(name, std::move(style))) { - if (strict_ && map.find_style(name)) + boost::optional dupe = map.find_style(name); + if (strict_) { - throw config_error("duplicate style name"); + if (dupe) + { + throw config_error("duplicate style name"); + } + throw config_error("failed to insert style to the map"); + } + else + { + std::string s_err("failed to insert style '"); + s_err += name + "' to the map"; + if (dupe) + { + s_err += " since it was already added"; + } + MAPNIK_LOG_ERROR(load_map) << "map_parser: " << s_err; } - throw config_error("failed to insert style to the map"); } } catch (config_error const& ex)