QXmppStanza::Error Class
class QXmppStanza::ErrorThe Error class represents a stanza error. More...
Public Types
| enum | Type { Cancel, Continue, Modify, Auth, Wait, NoType } |
Public Functions
| Error() | |
| Error(QXmppStanza::Error::Type type, QXmppStanza::Error::Condition cond, const QString &text = QString()) | |
| Error(const QString &type, const QString &cond, const QString &text = QString()) | |
| Error(const QXmppStanza::Error &) | |
| Error(QXmppStanza::Error &&) | |
| ~Error() | |
(since QXmpp 1.3) QString | by() const |
| int | code() const |
| QXmppStanza::Error::Condition | condition() const |
(since QXmpp 1.1) bool | fileTooLarge() const |
(since QXmpp 1.14) std::optional<QXmpp::JingleErrorCondition> | jingleErrorCondition() const |
(since QXmpp 1.1) qint64 | maxFileSize() const |
(since QXmpp 1.3) QString | redirectionUri() const |
(since QXmpp 1.1) QDateTime | retryDate() const |
(since QXmpp 1.3) void | setBy(const QString &by) |
| void | setCode(int code) |
| void | setCondition(QXmppStanza::Error::Condition cond) |
(since QXmpp 1.1) void | setFileTooLarge(bool fileTooLarge) |
(since QXmpp 1.14) void | setJingleErrorCondition(std::optional<QXmpp::JingleErrorCondition> condition) |
(since QXmpp 1.1) void | setMaxFileSize(qint64 maxFileSize) |
(since QXmpp 1.3) void | setRedirectionUri(const QString &redirectionUri) |
| void | setRetryDate(const QDateTime &retryDate) |
| void | setText(const QString &text) |
| void | setType(QXmppStanza::Error::Type type) |
| QString | text() const |
| QXmppStanza::Error::Type | type() const |
| QXmppStanza::Error & | operator=(QXmppStanza::Error &&) |
| QXmppStanza::Error & | operator=(const QXmppStanza::Error &) |
Detailed Description
Member Type Documentation
enum Error::Type
The type represents the error type of stanza errors.
The error descriptions are not detailed in here. The exact meaning can be found in the particular protocols using them.
| Constant | Value | Description |
|---|---|---|
QXmppStanza::Error::Cancel | 0 | The error is not temporary. |
QXmppStanza::Error::Continue | 1 | The error was only a warning. |
QXmppStanza::Error::Modify | 2 | The request needs to be changed and resent. |
QXmppStanza::Error::Auth | 3 | The request needs to be resent after authentication. |
QXmppStanza::Error::Wait | 4 | The error is temporary, you should wait and resend. |
QXmppStanza::Error::NoType | -1 |
Member Function Documentation
Error::Error()
Default constructor
Error::Error(QXmppStanza::Error::Type type, QXmppStanza::Error::Condition cond, const QString &text = QString())
Initializes an error with a type, condition and text.
Error::Error(const QString &type, const QString &cond, const QString &text = QString())
Initializes an error with a type, condition and text (all from strings).
Error::Error(const QXmppStanza::Error &)
Copy constructor
Error::Error(QXmppStanza::Error &&)
Move constructor
[noexcept] Error::~Error()
Default destructor
[since QXmpp 1.3] QString Error::by() const
Returns the optional JID of the creator of the error.
This is useful to ditinguish between errors generated by the local server and by the remote server for example. However, the value is optional.
This function was introduced in QXmpp 1.3.
See also setBy().
int Error::code() const
Returns the error code.
See also setCode().
QXmppStanza::Error::Condition Error::condition() const
Returns the error condition.
The conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect can be used in combination with redirectUri().
See also setCondition().
[since QXmpp 1.1] bool Error::fileTooLarge() const
Returns true, if an HTTP File Upload failed, because the file was too large.
This function was introduced in QXmpp 1.1.
See also setFileTooLarge().
[since QXmpp 1.14] std::optional<QXmpp::JingleErrorCondition> Error::jingleErrorCondition() const
Returns an additional XEP-0166: Jingle-specific error condition.
This function was introduced in QXmpp 1.14.
See also setJingleErrorCondition().
[since QXmpp 1.1] qint64 Error::maxFileSize() const
Returns the maximum file size allowed for uploading via. HTTP File Upload.
This function was introduced in QXmpp 1.1.
See also setMaxFileSize().
[since QXmpp 1.3] QString Error::redirectionUri() const
Returns the optionally included redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.
This function was introduced in QXmpp 1.3.
See also setRedirectionUri().
[since QXmpp 1.1] QDateTime Error::retryDate() const
Returns when to retry the upload request via. HTTP File Upload.
This function was introduced in QXmpp 1.1.
See also setRetryDate().
[since QXmpp 1.3] void Error::setBy(const QString &by)
Sets the optional JID of the creator of the error.
This is useful to ditinguish between errors generated by the local server and by the remote server for example. However, the value is optional.
by.
This function was introduced in QXmpp 1.3.
See also by().
void Error::setCode(int code)
Sets the error code.
See also code().
void Error::setCondition(QXmppStanza::Error::Condition cond)
Sets the error condition.
The conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect can be used in combination with setRedirectUri().
cond.
See also condition().
[since QXmpp 1.1] void Error::setFileTooLarge(bool fileTooLarge)
Sets whether the requested file for HTTP File Upload was too large.
You should also set maxFileSize in this case.
fileTooLarge.
This function was introduced in QXmpp 1.1.
See also fileTooLarge().
[since QXmpp 1.14] void Error::setJingleErrorCondition(std::optional<QXmpp::JingleErrorCondition> condition)
Sets an additional XEP-0166: Jingle-specific error condition.
condition.
This function was introduced in QXmpp 1.14.
See also jingleErrorCondition().
[since QXmpp 1.1] void Error::setMaxFileSize(qint64 maxFileSize)
Sets the maximum file size allowed for uploading via. HTTP File Upload.
This sets fileTooLarge to true.
maxFileSize.
This function was introduced in QXmpp 1.1.
See also maxFileSize().
[since QXmpp 1.3] void Error::setRedirectionUri(const QString &redirectionUri)
Sets the optional redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.
redirectionUri.
This function was introduced in QXmpp 1.3.
See also redirectionUri().
void Error::setRetryDate(const QDateTime &retryDate)
Sets the datetime when the client can retry to request the upload slot.
retryDate.
See also retryDate().
void Error::setText(const QString &text)
Sets the description of the error.
text.
See also text().
void Error::setType(QXmppStanza::Error::Type type)
Sets the type of the error.
See also type().
QString Error::text() const
Returns the human-readable description of the error.
See also setText().
QXmppStanza::Error::Type Error::type() const
Returns the type of the error.
See also setType().
QXmppStanza::Error &Error::operator=(QXmppStanza::Error &&)
Move operator
QXmppStanza::Error &Error::operator=(const QXmppStanza::Error &)
Copy operator