Loading...
Searching...
No Matches
QXmppError Class Reference

## Public Member Functions

bool | isFileError () const
bool | isNetworkError () const
bool | isStanzaError () const
template<typename T >
bool | holdsType () const
template<typename T >
std::optional< T > | value () const
template<typename T >
std::optional< T > | takeValue ()

## Static Public Member Functions

static QXmppError | fromIoDevice (const QIODevice &device)
static QXmppError | fromNetworkReply (const QNetworkReply &reply)
| Constructs a QXmppError from a QNetworkReply.
static QXmppError | fromFileDevice (const QFileDevice &file)
| Constructs a QXmppError from a QFileDevice.

## Public Attributes

QString | description
std::any | error

## Detailed Description

Generic error class holding a description and a more specific error object. The specific error usually is something like a QXmppStanza::Error or an enum.

Since
  QXmpp 1.5

## Member Function Documentation

## fromFileDevice()

QXmppError QXmppError::fromFileDevice | ( | const QFileDevice & | file | ) |

static

Constructs a QXmppError from a QFileDevice.

It creates a QXmppError with the error string and a QFileDevice::FileError.

## fromIoDevice()

QXmppError QXmppError::fromIoDevice | ( | const QIODevice & | device | ) |

static

Constructs a QXmppError from an QIODevice

It tries to cast the IO device to different known IO devices to get a useful more specific error, i.e. it returns a QXmppError with QFileDevice::FileError for QFileDevices.

## fromNetworkReply()

QXmppError QXmppError::fromNetworkReply | ( | const QNetworkReply & | reply | ) |

static

Constructs a QXmppError from a QNetworkReply.

It creates a QXmppError with the error string and network error from the reply.

## holdsType()

template<typename T >

QXmppError::holdsType | ( |  | ) | const

inline

Returns true if the error is of type T.

## isFileError()

bool QXmppError::isFileError | ( |  | ) | const

Returns whether the error is a QNetworkReply::NetworkError.

## isNetworkError()

bool QXmppError::isNetworkError | ( |  | ) | const

Returns whether the error is a QNetworkReply::NetworkError.

## isStanzaError()

bool QXmppError::isStanzaError | ( |  | ) | const

Returns whether the error is a QXmppStanza::Error.

## takeValue()

template<typename T >

QXmppError::takeValue | ( |  | ) |

inline

Moves out the value if it has type T, leaves the stored error intact and returns an empty optional otherwise.

## value()

template<typename T >

QXmppError::value | ( |  | ) | const

inline

Copies the value if it has type T, returns empty optional otherwise.

## Member Data Documentation

## description

QXmppError::description

Human readable description of the error.

## error

QXmppError::error

More specific details on the error. It may be of any type. Functions returning QXmppError should tell you which types are used.

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

- QXmppError.h
- QXmppError.cpp