Provide a more useful error for invalid column values.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2014-12-11 23:38:47 +00:00
parent eadf33033f
commit e8e4546870
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -369,7 +369,11 @@ class Schema:
elif rectype in ['pvu', 'preview']:
pass
elif rectype in ['col', 'column']:
self._columns = int(i.fields[1])
try:
self._columns = int(i.fields[1])
except ValueError:
raise newfol.exception.SchemaError("has non-integral " +
"number of columns")
elif rectype in ['txn', 'transaction']:
self._txntype = i.fields[1:]
elif rectype in ['dpy', 'display']: