- commit
- cf99a23abc7bb7299ca01af2e237e1ddde1613f1
- parent
- 29525d5bc74b58588bf9a1042ffcd2715256ef8d
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2014-04-20 21:02
improve error handling
Diffstat
| M | cctool.py | 6 | ++++-- |
1 files changed, 4 insertions, 2 deletions
diff --git a/cctool.py b/cctool.py
@@ -29,6 +29,7 @@ 29 29 # - sort 30 30 # - filter 31 31 # - unicode -1 32 # - error handling 32 33 33 34 import os 34 35 import sys @@ -187,8 +188,9 @@ class LDIF(Format): 187 188 parser = LDIFParser(fh) 188 189 try: 189 190 parser.parse()190 -1 except ValueError:191 -1 log.warning("ValueError after reading %i records" % parser.records_read)-1 191 except ValueError as e: -1 192 log.warning("ValueError after reading %i records: %s" -1 193 % (parser.records_read, e)) 192 194 for entry in parser.entries.itervalues(): 193 195 yield MultiDict(entry) 194 196