Xapian: API Documentation: Xapian::Error Class Reference

xapian-core 2.0.0

Public Member Functions | List of all members
Xapian::Error Class Reference

All exceptions thrown by Xapian are subclasses of Xapian::Error. More...

`#include <error.h>`

Inheritance diagram for Xapian::Error:
[legend]

## Public Member Functions
| Error (const Error &)=default
| Default copy constructor.
const char * | get_type () const noexcept
| The type of this error (e.g. "DocNotFoundError".).
const std::string & | get_msg () const noexcept
| Message giving details of the error, intended for human consumption.
const std::string & | get_context () const noexcept
| Optional context information.
const char * | get_error_string () const
| Returns any system error string associated with this exception.
std::string | get_description () const
| Return a string describing this object.

## Detailed Description

All exceptions thrown by Xapian are subclasses of Xapian::Error.

This class can not be instantiated directly - instead a subclass should be used.

## Constructor & Destructor Documentation

## ◆ Error()

Xapian::Error::Error | ( | const Error & |  | ) |
| default

Default copy constructor.

We explicitly specify this to avoid warnings from GCC 9 (from -Wdeprecated-copy which is enabled by -Wextra).

## Member Function Documentation

## ◆ get_context()

const std::string & Xapian::Error::get_context | ( |  | ) | const
| inlinenoexcept

Optional context information.

This context is intended for machine use (for example to know which remote server an error came from), but it is typically a plain-text string, and so also fit for human consumption.

## ◆ get_error_string()

const char * Xapian::Error::get_error_string | ( |  | ) | const

Returns any system error string associated with this exception.

The system error string may come from errno, h_errno (on UNIX), or GetLastError() (on MS Windows). If there is no associated system error string, NULL is returned.

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

- xapian/error.h