From c1d441d0932d144e4f1dfa9f778c1f6f047e6a43 Mon Sep 17 00:00:00 2001 From: JoepvandenHoven-Bluemine <46192597+JoepvandenHoven-Bluemine@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:20:44 +0000 Subject: [PATCH] Add more descriptive error message Not sure if this is the clearest way to explain what's happening, but it's better than "Unboundlocal" --- pygml/parse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygml/parse.py b/pygml/parse.py index 2ff3cc3..93c044a 100644 --- a/pygml/parse.py +++ b/pygml/parse.py @@ -54,5 +54,7 @@ def parse(source: Union[etree._Element, str]) -> Geometry: result = parse_v33_ce(element) elif namespace == NAMESPACE_GEORSS: result = parse_georss(element) + else: + raise RuntimeError(f"Could not parse element {element}, unrecognized namespace. Did you select the correct node?") return Geometry(result)