mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(blocks): Improve XML parsing error handling with specific AttributeError message
This commit is contained in:
committed by
GitHub
parent
3f546ae845
commit
42904c6a41
@@ -39,6 +39,12 @@ class XMLParserBlock(Block):
|
||||
parser = Parser(tokens)
|
||||
parsed_result = parser.parse()
|
||||
yield "parsed_xml", parsed_result
|
||||
except AttributeError as attr_e:
|
||||
raise ValueError(
|
||||
f"XML parsing error: The gravitasml library encountered an incompatible structure. "
|
||||
f"This may occur with certain XML formats that create List objects with text content. "
|
||||
f"Details: {attr_e}"
|
||||
) from attr_e
|
||||
except ValueError as val_e:
|
||||
raise ValueError(f"Validation error for dict:{val_e}") from val_e
|
||||
except SyntaxError as syn_e:
|
||||
|
||||
Reference in New Issue
Block a user