Displaying 2 results from an estimated 2 matches for "swig_ioerror".
2007 Mar 03
1
Error handling in the bindings
Currently, the SWIG generated bindings catch exceptions raised by Xapian
and rethrow them using the standard SWIG error types: for example, if
any Xapian::DatabaseError exception is raised, SWIG will use its
standard SWIG_IOError error type to report the error.
In Python, this leads to code like the following:
try:
db.get_document(1)
except RuntimeError, e:
if str(e).startswith('DocNotFoundError:'):
# Handle a DocNotFoundError
(Incidentally, the error raised in python for this actually is a
Ru...
2007 Mar 03
1
Error handling in the bindings
Currently, the SWIG generated bindings catch exceptions raised by Xapian
and rethrow them using the standard SWIG error types: for example, if
any Xapian::DatabaseError exception is raised, SWIG will use its
standard SWIG_IOError error type to report the error.
In Python, this leads to code like the following:
try:
db.get_document(1)
except RuntimeError, e:
if str(e).startswith('DocNotFoundError:'):
# Handle a DocNotFoundError
(Incidentally, the error raised in python for this actually is a
Ru...