QXmpp  Version:1.3.0
Public Types | Public Member Functions | List of all members
QXmppStanza::Error Class Reference

The Error class represents a stanza error. More...

#include <QXmppStanza.h>

Public Types

enum  Type {
  Cancel, Continue, Modify, Auth,
  Wait
}
 
enum  Condition {
  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 (Type type, Condition cond, const QString &text=QString())
 
 Error (const QString &type, const QString &cond, const QString &text=QString())
 
 ~Error ()
 Default destructor.
 
Erroroperator= (const Error &)
 Copy operator.
 
int code () const
 
void setCode (int code)
 
QString text () const
 
void setText (const QString &text)
 
Condition condition () const
 
void setCondition (Condition cond)
 
void setType (Type type)
 
Type type () const
 
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 &)
 Sets the datetime when the client can retry to request the upload slot.
 

Detailed Description

The Error class represents a stanza error.

Member Enumeration Documentation

◆ Condition

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.

Deprecated:
This error condition is deprecated since QXmpp 1.3 as it was not adopted in RFC6120.
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.

Since
QXmpp 1.3

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

Enumerator
Cancel 

The error is not temporary.

Continue 

The error was only a warning.

Modify 

The request needs to be changed and resent.

Auth 

The request needs to be resent after authentication.

Wait 

The error is temporary, you should wait and resend.

Constructor & Destructor Documentation

◆ Error() [1/3]

QXmppStanza::Error::Error ( )

Default constructor

◆ Error() [2/3]

QXmppStanza::Error::Error ( Type  type,
Condition  cond,
const QString &  text = QString() 
)

Initializes an error with a type, condition and text.

◆ Error() [3/3]

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

Member Function Documentation

◆ by()

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.

Since
QXmpp 1.3

◆ code()

int QXmppStanza::Error::code ( ) const

Returns the error code.

◆ condition()

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

◆ fileTooLarge()

bool QXmppStanza::Error::fileTooLarge ( ) const

Returns true, if an HTTP File Upload failed, because the file was too large.

Since
QXmpp 1.1

◆ maxFileSize()

qint64 QXmppStanza::Error::maxFileSize ( ) const

Returns the maximum file size allowed for uploading via. HTTP File Upload.

Since
QXmpp 1.1

◆ redirectionUri()

QString QXmppStanza::Error::redirectionUri ( ) const

Returns the optionally included redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.

See also
setRedirectionUri()
Since
QXmpp 1.3

◆ retryDate()

QDateTime QXmppStanza::Error::retryDate ( ) const

Returns when to retry the upload request via. HTTP File Upload.

Since
QXmpp 1.1

◆ setBy()

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.

Since
QXmpp 1.3

◆ setCode()

void QXmppStanza::Error::setCode ( int  code)

Sets the error code.

◆ setCondition()

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

◆ setFileTooLarge()

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.

Since
QXmpp 1.1

◆ setMaxFileSize()

void QXmppStanza::Error::setMaxFileSize ( qint64  maxFileSize)

Sets the maximum file size allowed for uploading via. HTTP File Upload.

This sets fileTooLarge to true.

Since
QXmpp 1.1

◆ setRedirectionUri()

void QXmppStanza::Error::setRedirectionUri ( const QString &  redirectionUri)

Sets the optional redirection URI for the error conditions QXmppStanza::Error::Gone and QXmppStanza::Error::Redirect.

See also
redirectionUri()
Since
QXmpp 1.3

◆ setText()

void QXmppStanza::Error::setText ( const QString &  text)

Sets the description of the error.

◆ setType()

void QXmppStanza::Error::setType ( Type  type)

Sets the type of the error.

◆ text()

QString QXmppStanza::Error::text ( ) const

Returns the human-readable description of the error.

◆ type()

QXmppStanza::Error::Type QXmppStanza::Error::type ( ) const

Returns the type of the error.


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