Class for transporting D-Bus errors. More...
#include <qdbuserror.h>
Public Types | |
enum | ErrorType { InvalidError, Failed, NoMemory, ServiceUnknown, NameHasNoOwner, NoReply, IOError, BadAddress, NotSupported, LimitsExceeded, AccessDenied, AuthFailed, NoServer, Timeout, NoNetwork, Disconnected, InvalidArgs, FileNotFound, FileExists, UnknownMethod, TimedOut, InvalidSignature, UserDefined } |
Enum of standard D-Bus error types. More... | |
Public Member Functions | |
QDBusError () | |
Creates an empty and invalid error object. | |
QDBusError (const DBusError *error) | |
Creates an error object from an C API D-Bus error object. | |
QDBusError (const QString &error, const QString &message) | |
Creates an error object for its two given components. | |
QString | name () const |
Returns the D-Bus error name. | |
QString | message () const |
Returns a string describing the error. | |
ErrorType | type () const |
Returns a type for checking of standard errors. | |
bool | isValid () const |
Returns whether the error object is valid. | |
Static Public Member Functions | |
static QDBusError | stdFailed (const QString &message) |
Creates a D-Bus standard error for generic failure. | |
static QDBusError | stdNoMemory (const QString &message) |
Creates a D-Bus standard error for out of memory situations. | |
static QDBusError | stdNoReply (const QString &message) |
Creates a D-Bus standard error for expected reply missing. | |
static QDBusError | stdIOError (const QString &message) |
Creates a D-Bus standard error for generic IO errors. | |
static QDBusError | stdNotSupported (const QString &message) |
Creates a D-Bus standard error for unsupported operations. | |
static QDBusError | stdLimitsExceeded (const QString &message) |
Creates a D-Bus standard error for exceeding a limited resource. | |
static QDBusError | stdAccessDenied (const QString &message) |
Creates a D-Bus standard error for access to a resource being denied. | |
static QDBusError | stdAuthFailed (const QString &message) |
Creates a D-Bus standard error for failed authentification. | |
static QDBusError | stdTimeout (const QString &message) |
Creates a D-Bus standard error for timeouts during operations. | |
static QDBusError | stdInvalidArgs (const QString &message) |
Creates a D-Bus standard error for call arguments being invalid. | |
static QDBusError | stdFileNotFound (const QString &message) |
Creates a D-Bus standard error for a file not being available. | |
static QDBusError | stdFileExists (const QString &message) |
Creates a D-Bus standard error for a file being in the way. | |
static QDBusError | stdUnknownMethod (const QString &message) |
Creates a D-Bus standard error for an unknown methods being called. | |
static QDBusError | stdInvalidSignature (const QString &message) |
Creates a D-Bus standard error for D-Bus type signature not valid. |
Class for transporting D-Bus errors.
A D-Bus error has two parts: an error name (see section Error names) and a message string detailing the error in human presentable form.
Enum of standard D-Bus error types.
D-Bus defines a list of common error types and their names. The values of this enum map to those an application is likely to encounter and likely to create itself.
Standard errors can either be created by specifying the D-Bus error name or, as a convenience, by using factory methods of this class for the most common ones.
All D-Bus standard error names are within the "org.freedesktop.DBus.Error"
namespace.
InvalidError |
QDBusError specific value, to represent invalid error objects.
|
Failed |
Generic failure cause. Can be used whenever the other predefined errors do no match. Basically just meaning "something when wrong, see message() for details"
|
NoMemory |
An operation could not allocate enough memory.
|
ServiceUnknown |
An addressed service is neither connected nor can it be activated. |
NameHasNoOwner |
A non-unique name used in a message is not known. If a message addresses a D-Bus connection through a non-unique (requested) name and the D-Bus does not have a mapping to any of the unique names. |
NoReply |
An call failed to send a reply but one was expected.
|
IOError |
An IO error occured during an operation. Generic indicator that some kind of IO operation failed, e.g. reading from a socket.
|
BadAddress |
Caused by trying to connect to a malformed address. Returned by QDBusConnection's addConnection if the specified address isn't a valid D-Bus bus address. |
NotSupported |
An otherwise valid operation request could not be handled. Primarily useful when a service implements a specific interface but does not (yet) handle all possible situations.
|
LimitsExceeded |
Use of a limited resource reached its limit.
|
AccessDenied |
Caused by security restrictions denying an operation. Primarily useful when a client tries to manipulate resources a service has associated with a different client and which should not be changable by anyone else.
|
AuthFailed |
An authentification mechanism failed.
|
NoServer |
Connection to a D-Bus server failed. |
Timeout |
An timeout occured during an operation.
|
NoNetwork |
The network intended as a transport channel is not available. |
Disconnected |
Caused by trying to use an unconnected D-Bus connection.
|
InvalidArgs |
Caused by invalid arguments passed to a method call. Primarily usefull for service implementations when the incoming call does not transport the expected parameters, e.g. wrong types or wrong values.
|
FileNotFound |
A file necessary for an operation is not avaiable.
|
FileExists |
Target file exists but operation does not allow overwriting.
|
UnknownMethod |
A method call addresses and unknown method.
|
TimedOut |
An operation timed out.
|
InvalidSignature |
An type signature is not valid. A possible cause is a QDBusVariant with an invalid signature, i.e. the transported signature is empty, contains unknown type characters or has mismatched container enclosings.
|
UserDefined |
Generic type for all errors not matching on of the other predefined. |
QDBusError::QDBusError | ( | ) |
Creates an empty and invalid error object.
QDBusError::QDBusError | ( | const DBusError * | error | ) |
Creates an error object from an C API D-Bus error object.
error | a pointer to the C API D-Bus error |
QDBusError::QDBusError | ( | const QString & | error, | |
const QString & | message | |||
) |
Creates an error object for its two given components.
error | a D-Bus error name | |
message | the potentially i18n'ed error description message |
bool QDBusError::isValid | ( | ) | const |
Returns whether the error object is valid.
A QDBusError is considered valid if both name and message are set.
true
if neither name nor message is QString::null
and the error type is a valid type QString QDBusError::message | ( | ) | const [inline] |
Returns a string describing the error.
The message is meant to further detail or describe the error. It is usually a translated error message meant for direct presentation to the user.
QString QDBusError::name | ( | ) | const [inline] |
Returns the D-Bus error name.
See section Error names for details.
static QDBusError QDBusError::stdAccessDenied | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for access to a resource being denied.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdAuthFailed | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for failed authentification.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdFailed | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for generic failure.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdFileExists | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for a file being in the way.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdFileNotFound | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for a file not being available.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdInvalidArgs | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for call arguments being invalid.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdInvalidSignature | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for D-Bus type signature not valid.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdIOError | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for generic IO errors.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdLimitsExceeded | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for exceeding a limited resource.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdNoMemory | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for out of memory situations.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdNoReply | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for expected reply missing.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdNotSupported | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for unsupported operations.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdTimeout | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for timeouts during operations.
message | the message detailing the encountered problem |
message
static QDBusError QDBusError::stdUnknownMethod | ( | const QString & | message | ) | [static] |
Creates a D-Bus standard error for an unknown methods being called.
message | the message detailing the encountered problem |
message
ErrorType QDBusError::type | ( | ) | const [inline] |
Returns a type for checking of standard errors.
D-Bus specifies a couple of standard error names, which are mapped to QDBusError types in order to make creating and checking for them easier.