I get errors like this
return SegmentWriter(self, **kwargs)
File "/usr/local/lib/python2.7/site-packages/whoosh/writing.py", line 502, in __init__
raise LockError
whoosh.index.LockError
I would like to catch these errors with a try/except statement. So I wrote
try:
do whatever causes the error
except LockError:
print "LockError..."
handle error
but this leads to a NameError, since LockError is unknown?
except LockError:
NameError: global name 'LockError' is not defined
how do I handle these Lock errors?
except whoosh.index.LockError:?except Exception as e:in the next lineprint e