SEL-Columbia / pyxform

A Python package to create XForms for ODK Collect.
21 stars 9 forks source link

More meaningful exception message. #104

Closed vernondcole closed 10 years ago

vernondcole commented 10 years ago

While working on back-door publishing of .xml forms to formhub, I was blown away by an AssertionError. These are normally caused by program logic errors. (Which may have been the case when this module is used for its intended purpose.) I replaced the two "assert" calls with the more usual Python "easier to get forgiveness than permission" pattern, and a TypeError with some diagnostic text.

It might have been better to raise ValueError, but I noticed that TypeError was used elsewhere in the module.

prabhasp commented 10 years ago

Looks cleaner!