QXmpp Version: 1.5.6
|
The Error class represents a stanza error. More...
#include <QXmppStanza.h>
Public Types | |
enum | Type { NoType = -1 , Cancel , Continue , Modify , Auth , Wait } |
enum | Condition { NoCondition = -1 , BadRequest , Conflict , FeatureNotImplemented , Forbidden , Gone , InternalServerError , ItemNotFound , JidMalformed , NotAcceptable , NotAllowed , NotAuthorized , Q_DECL_ENUMERATOR_DEPRECATED_X =("The <payment-required/> error was removed in RFC6120") , RecipientUnavailable = 12 , Redirect , RegistrationRequired , RemoteServerNotFound , RemoteServerTimeout , ResourceConstraint , ServiceUnavailable , SubscriptionRequired , UndefinedCondition , UnexpectedRequest , PolicyViolation } |
A detailed condition of the error. More... | |
Public Member Functions | |
Error () | |
Error (const Error &) | |
Copy constructor. | |
Error (Error &&) | |
Move constructor. | |
Error (Type type, Condition cond, const QString &text=QString()) | |
Error (const QString &type, const QString &cond, const QString &text=QString()) | |
~Error () | |
Default destructor. | |
Error & | operator= (const Error &) |
Copy operator. | |
Error & | operator= (Error &&) |
Move operator. | |
int | code () const |
void | setCode (int code) |
QString | text () const |
void | setText (const QString &text) |
Condition | condition () const |
void | setCondition (Condition cond) |
Type | type () const |
void | setType (Type type) |
QString | by () const |
void | setBy (const QString &by) |
QString | redirectionUri () const |
void | setRedirectionUri (const QString &redirectionUri) |
bool | fileTooLarge () const |
void | setFileTooLarge (bool) |
qint64 | maxFileSize () const |
void | setMaxFileSize (qint64) |
QDateTime | retryDate () const |
void | setRetryDate (const QDateTime &) |
Friends | |
class | QXmppStanza |
The Error class represents a stanza error.
A detailed condition of the error.
Enumerator | |
---|---|
BadRequest | The request does not contain a valid schema. |
Conflict | The request conflicts with another. |
FeatureNotImplemented | The feature is not implemented. |
Forbidden | The requesting entity does not posses the necessary privileges to perform the request. |
Gone | The user or server can not be contacted at the address. This is used in combination with a redirection URI. |
InternalServerError | The server has expierienced an internal error and can not process the request. |
ItemNotFound | The requested item could not be found. |
JidMalformed | The given JID is not valid. |
NotAcceptable | The request does not meet the defined critera. |
NotAllowed | No entity is allowed to perform the request. |
NotAuthorized | The request should be resent after authentication. |
Q_DECL_ENUMERATOR_DEPRECATED_X | Payment is required to perform the request.
|
RecipientUnavailable | The recipient is unavailable. |
Redirect | The requested resource is available elsewhere. This is used in combination with a redirection URI. |
RegistrationRequired | The requesting entity needs to register first. |
RemoteServerNotFound | The remote server could not be found. |
RemoteServerTimeout | The connection to the server could not be established or timed out. |
ResourceConstraint | The recipient lacks system resources to perform the request. |
ServiceUnavailable | The service is currently not available. |
SubscriptionRequired | The requester needs to subscribe first. |
UndefinedCondition | An undefined condition was hit. |
UnexpectedRequest | The request was unexpected. |
PolicyViolation | The entity has violated a local server policy.
|
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.
QXmppStanza::Error::Error | ( | ) |
Default constructor
Initializes an error with a type, condition and text.
QXmppStanza::Error::Error | ( | const QString & | type, |
const QString & | cond, | ||
const QString & | text = QString() |
||
) |
Initializes an error with a type, condition and text (all from strings).
QString QXmppStanza::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.
int QXmppStanza::Error::code | ( | ) | const |
Returns the error code.
QXmppStanza::Error::Condition QXmppStanza::Error::condition | ( | ) | const |
Returns the error condition.
The conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect can be used in combination with redirectUri().
bool QXmppStanza::Error::fileTooLarge | ( | ) | const |
Returns true, if an HTTP File Upload failed, because the file was too large.
qint64 QXmppStanza::Error::maxFileSize | ( | ) | const |
Returns the maximum file size allowed for uploading via. HTTP File Upload.
QString QXmppStanza::Error::redirectionUri | ( | ) | const |
Returns the optionally included redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.
QDateTime QXmppStanza::Error::retryDate | ( | ) | const |
Returns when to retry the upload request via. HTTP File Upload.
void QXmppStanza::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.
void QXmppStanza::Error::setCode | ( | int | code | ) |
Sets the error code.
void QXmppStanza::Error::setCondition | ( | Condition | cond | ) |
Sets the error condition.
The conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect can be used in combination with setRedirectUri().
void QXmppStanza::Error::setFileTooLarge | ( | bool | fileTooLarge | ) |
Sets whether the requested file for HTTP File Upload was too large.
You should also set maxFileSize in this case.
void QXmppStanza::Error::setMaxFileSize | ( | qint64 | maxFileSize | ) |
Sets the maximum file size allowed for uploading via. HTTP File Upload.
This sets fileTooLarge to true.
void QXmppStanza::Error::setRedirectionUri | ( | const QString & | redirectionUri | ) |
Sets the optional redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.
void QXmppStanza::Error::setRetryDate | ( | const QDateTime & | retryDate | ) |
Sets the datetime when the client can retry to request the upload slot.
void QXmppStanza::Error::setText | ( | const QString & | text | ) |
Sets the description of the error.
void QXmppStanza::Error::setType | ( | Type | type | ) |
Sets the type of the error.
QString QXmppStanza::Error::text | ( | ) | const |
Returns the human-readable description of the error.
QXmppStanza::Error::Type QXmppStanza::Error::type | ( | ) | const |
Returns the type of the error.