Skip to content

Commit 47bf171

Browse files
Log unexpected elements when strict is False
1 parent 98caaba commit 47bf171

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/zeep/xsd/types/complex.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ def parse_xmlelement(self, xmlelement, schema=None, allow_none=True,
174174

175175
# Check if all children are consumed (parsed)
176176
if elements:
177+
err_msg = "Unexpected element %r"
177178
if schema.settings.strict:
178-
raise XMLParseError("Unexpected element %r" % elements[0].tag)
179-
else:
180-
init_kwargs['_raw_elements'] = elements
179+
raise XMLParseError(err_msg % elements[0].tag)
180+
init_kwargs['_raw_elements'] = elements
181+
for element in elements:
182+
logger.debug(err_msg % element.tag)
181183

182184
# Parse attributes
183185
if attributes:

0 commit comments

Comments
 (0)