DBus-1-TQt
1.0
|
#include <tqdbuserror.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 } |
Public Member Functions | |
TQT_DBusError () | |
TQT_DBusError (const DBusError *error) | |
TQT_DBusError (const TQString &error, const TQString &message) | |
TQString | name () const |
TQString | message () const |
ErrorType | type () const |
bool | dbusErrorSet () const |
void | setDBUSError (bool err) const |
bool | isValid () const |
Static Public Member Functions | |
static TQT_DBusError | stdFailed (const TQString &message) |
static TQT_DBusError | stdNoMemory (const TQString &message) |
static TQT_DBusError | stdNoReply (const TQString &message) |
static TQT_DBusError | stdIOError (const TQString &message) |
static TQT_DBusError | stdNotSupported (const TQString &message) |
static TQT_DBusError | stdLimitsExceeded (const TQString &message) |
static TQT_DBusError | stdAccessDenied (const TQString &message) |
static TQT_DBusError | stdAuthFailed (const TQString &message) |
static TQT_DBusError | stdTimeout (const TQString &message) |
static TQT_DBusError | stdInvalidArgs (const TQString &message) |
static TQT_DBusError | stdFileNotFound (const TQString &message) |
static TQT_DBusError | stdFileExists (const TQString &message) |
static TQT_DBusError | stdUnknownMethod (const TQString &message) |
static TQT_DBusError | stdInvalidSignature (const TQString &message) |
Private Member Functions | |
TQT_DBusError (ErrorType type, const TQString &message) | |
Private Attributes | |
ErrorType | errorType |
bool | m_dbusErrorSet |
TQString | nm |
TQString | msg |
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.
Definition at line 40 of file tqdbuserror.h.
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.
Enumerator | |
---|---|
InvalidError | TQT_DBusError 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 TQT_DBusConnection'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 TQT_DBusVariant 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. |
Definition at line 59 of file tqdbuserror.h.
TQT_DBusError::TQT_DBusError | ( | ) |
Creates an empty and invalid error object.
Definition at line 116 of file tqdbuserror.cpp.
TQT_DBusError::TQT_DBusError | ( | 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 |
Definition at line 120 of file tqdbuserror.cpp.
References errorType, msg, nm, and qDBusErrorTypeForName().
TQT_DBusError::TQT_DBusError | ( | const TQString & | error, |
const TQString & | message | ||
) |
Creates an error object for its two given components.
error | a D-Bus error name |
message | the potentially i18n'ed error description message |
Definition at line 131 of file tqdbuserror.cpp.
References errorType, nm, and qDBusErrorTypeForName().
|
private |
Creates an error object for one of the standard D-Bus errors.
type | one of the standard error causes |
message | the potentially i18n'ed error description message |
Definition at line 142 of file tqdbuserror.cpp.
References nm, qDBusErrorNameForType(), and type().
|
inline |
Returns whether the error was caused by DBUS itself.
A TQT_DBusError is considered valid if both name and message are set.
true
if dbus_error_is_set was true after DBUS call completion Definition at line 316 of file tqdbuserror.h.
bool TQT_DBusError::isValid | ( | ) | const |
Returns whether the error object is valid.
A TQT_DBusError is considered valid if both name and message are set.
true
if neither name nor message is TQString()
and the error type is a valid type Definition at line 137 of file tqdbuserror.cpp.
References errorType, InvalidError, msg, and nm.
|
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.
Definition at line 295 of file tqdbuserror.h.
|
inline |
Returns the D-Bus error name.
See section Error names for details.
Definition at line 282 of file tqdbuserror.h.
|
inline |
|
static |
Creates a D-Bus standard error for access to a resource being denied.
message | the message detailing the encountered problem |
message
Definition at line 178 of file tqdbuserror.cpp.
References AccessDenied, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for failed authentification.
message | the message detailing the encountered problem |
message
Definition at line 183 of file tqdbuserror.cpp.
References AuthFailed, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for generic failure.
message | the message detailing the encountered problem |
message
Definition at line 148 of file tqdbuserror.cpp.
References Failed, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for a file being in the way.
message | the message detailing the encountered problem |
message
Definition at line 203 of file tqdbuserror.cpp.
References FileExists, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for a file not being available.
message | the message detailing the encountered problem |
message
Definition at line 198 of file tqdbuserror.cpp.
References FileNotFound, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for call arguments being invalid.
message | the message detailing the encountered problem |
message
Definition at line 193 of file tqdbuserror.cpp.
References InvalidArgs, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for D-Bus type signature not valid.
message | the message detailing the encountered problem |
message
Definition at line 213 of file tqdbuserror.cpp.
References InvalidSignature, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for generic IO errors.
message | the message detailing the encountered problem |
message
Definition at line 163 of file tqdbuserror.cpp.
References IOError, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for exceeding a limited resource.
message | the message detailing the encountered problem |
message
Definition at line 173 of file tqdbuserror.cpp.
References LimitsExceeded, message(), and TQT_DBusError().
|
static |
Creates a D-Bus standard error for out of memory situations.
message | the message detailing the encountered problem |
message
Definition at line 153 of file tqdbuserror.cpp.
References message(), NoMemory, and TQT_DBusError().
|
static |
Creates a D-Bus standard error for expected reply missing.
message | the message detailing the encountered problem |
message
Definition at line 158 of file tqdbuserror.cpp.
References message(), NoReply, and TQT_DBusError().
|
static |
Creates a D-Bus standard error for unsupported operations.
message | the message detailing the encountered problem |
message
Definition at line 168 of file tqdbuserror.cpp.
References message(), NotSupported, and TQT_DBusError().
|
static |
Creates a D-Bus standard error for timeouts during operations.
message | the message detailing the encountered problem |
message
Definition at line 188 of file tqdbuserror.cpp.
References message(), Timeout, and TQT_DBusError().
|
static |
Creates a D-Bus standard error for an unknown methods being called.
message | the message detailing the encountered problem |
message
Definition at line 208 of file tqdbuserror.cpp.
References message(), TQT_DBusError(), and UnknownMethod.
|
inline |
Returns a type for checking of standard errors.
D-Bus specifies a couple of standard error names, which are mapped to TQT_DBusError types in order to make creating and checking for them easier.
Definition at line 307 of file tqdbuserror.h.
|
private |
Definition at line 460 of file tqdbuserror.h.
|
mutableprivate |
Definition at line 461 of file tqdbuserror.h.
|
private |
Definition at line 463 of file tqdbuserror.h.
|
private |
Definition at line 463 of file tqdbuserror.h.