wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

XML extractor doesn't report critical errors #15

Closed robinharms closed 10 years ago

robinharms commented 11 years ago

https://github.com/wichert/lingua/blob/master/src/lingua/extractors/xml.py#L67

The try / except statement here swallows all critical errors, aborts processing of that template and never reports them. Since at least I make a lot of errors when i write templates, it would be great to know when I screw up :)

The best would be if errors were printed at the end of processing, or an optional switch to actually die during processing. But even a quick fix like this would be better than nothing:

    try:
        self.parser.ParseFile(fileobj)
    except expat.ExpatError, e:
        print e

Thanks a lot for working with this software :) Regards, Robin

wichert commented 10 years ago

The current version of lingua will show any critical syntax errors, and abort on them.

robinharms commented 10 years ago

Great thanks a lot!