plone / plone.supermodel

Provides XML import and export for schema interfaces based on zope.schema fields
5 stars 8 forks source link

Improve reporting of parse errors #2

Closed davisagli closed 12 years ago

davisagli commented 12 years ago

This branch makes supermodel report exceptions encountered while parsing a model in a much more helpful way. (Currently the exception does not even identify which model file was being parsed.)

The parser now keeps track of the current element being processed in a thread local stack so that it can be reported if there is an exception.

The filename is always reported. If lxml is present then we can also get the line number of the element and include the line in the exception message.

garbas commented 12 years ago

+1 ... very nice, didn't ran the code just got excited about what it promises :)