mirror of
https://github.com/enzet/map-machine.git
synced 2025-04-29 18:27:19 +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"]
|
id_: str = node.attrib["id"]
|
||||||
if STANDARD_INKSCAPE_ID_MATCHER.match(id_) is not None:
|
if STANDARD_INKSCAPE_ID_MATCHER.match(id_) is not None:
|
||||||
if not verify_sketch_element(node, id_):
|
if not verify_sketch_element(node, id_):
|
||||||
logging.warning(
|
path_part = ""
|
||||||
f"Not verified SVG element `{id_}`, "
|
try:
|
||||||
f"{node.attrib['d'].split(' ')[:3]}."
|
path_part = f", {node.attrib['d'].split(' ')[:3]}."
|
||||||
)
|
except (KeyError, ValueError):
|
||||||
|
pass
|
||||||
|
logging.warning(f"Not verified SVG element `{id_}`{path_part}")
|
||||||
return
|
return
|
||||||
|
|
||||||
if "d" in node.attrib and node.attrib["d"]:
|
if "d" in node.attrib and node.attrib["d"]:
|
||||||
|
|
Loading…
Add table
Reference in a new issue