xapian-core
1.4.27
|
Decide if a Xapian::Error exception should be ignored. More...
#include <errorhandler.h>
Public Member Functions | |
ErrorHandler () | |
Default constructor. | |
virtual | ~ErrorHandler () |
We require a virtual destructor because we have virtual methods. | |
void | operator() (Xapian::Error &error) |
Handle a Xapian::Error object. | |
ErrorHandler * | release () |
Start reference counting this object. | |
const ErrorHandler * | release () const |
Start reference counting this object. | |
Decide if a Xapian::Error exception should be ignored.
You can create your own subclass of this class and pass in an instance of it when you construct a Xapian::Enquire object. Xapian::Error exceptions which happen during the match process are passed to this object and it can decide whether they should propagate or whether Enquire should attempt to continue.
The motivation is to allow searching over remote databases to handle a remote server which has died (both to allow results to be returned, and also so that such errors can be logged and dead servers temporarily removed from use).
void Xapian::ErrorHandler::operator() | ( | Xapian::Error & | error | ) |
Handle a Xapian::Error object.
This method is called when a Xapian::Error object is thrown and caught inside Enquire. If this is the first ErrorHandler that the Error has been passed to, then the handle_error() virtual method is called, which allows the API user to decide how to handle the error.
error | The Xapian::Error object under consideration. |
|
inline |
Start reference counting this object.
You can hand ownership of a dynamically allocated ErrorHandler object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.
|
inline |
Start reference counting this object.
You can hand ownership of a dynamically allocated ErrorHandler object to Xapian by calling release() and then passing the object to a Xapian method. Xapian will arrange to delete the object once it is no longer required.