#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. |
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).
Xapian::ErrorHandler::ErrorHandler | ( | ) | [inline] |
Default constructor.
virtual Xapian::ErrorHandler::~ErrorHandler | ( | ) | [virtual] |
We require a virtual destructor because we have virtual methods.
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. |