mirror of
https://github.com/enzet/map-machine.git
synced 2025-04-29 10:17:23 +02:00
Add error handling for SVG parsing.
This commit is contained in:
parent
cb1bdceedb
commit
cdbcedc6ec
1 changed files with 6 additions and 4 deletions
|
@ -310,10 +310,12 @@ class ShapeExtractor:
|
|||
id_: str = node.attrib["id"]
|
||||
if STANDARD_INKSCAPE_ID_MATCHER.match(id_) is not None:
|
||||
if not verify_sketch_element(node, id_):
|
||||
logging.warning(
|
||||
f"Not verified SVG element `{id_}`, "
|
||||
f"{node.attrib['d'].split(' ')[:3]}."
|
||||
)
|
||||
path_part = ""
|
||||
try:
|
||||
path_part = f", {node.attrib['d'].split(' ')[:3]}."
|
||||
except (KeyError, ValueError):
|
||||
pass
|
||||
logging.warning(f"Not verified SVG element `{id_}`{path_part}")
|
||||
return
|
||||
|
||||
if "d" in node.attrib and node.attrib["d"]:
|
||||
|
|
Loading…
Add table
Reference in a new issue