Xapian: API Documentation: Xapian::ErrorHandler Class Reference

Public Member Functions | List of all members
Xapian::ErrorHandler Class Referenceabstract

Decide if a Xapian::Error exception should be ignored. More...

Inheritance diagram for Xapian::ErrorHandler:
[legend]

## 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. More...
ErrorHandler * | release ()
| Start reference counting this object. More...
const ErrorHandler * | release () const
| Start reference counting this object. More...

## Detailed Description

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).

## Member Function Documentation

## ◆ operator()()

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.

Parameters

  error | The Xapian::Error object under consideration.

## ◆ release() [1/2]

ErrorHandler* Xapian::ErrorHandler::release | ( |  | ) |
| 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.

## ◆ release() [2/2]

const ErrorHandler* Xapian::ErrorHandler::release | ( |  | ) | const
| 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.

The documentation for this class was generated from the following file:

- xapian/errorhandler.h