Qt 4.8
|
The QDBusError class represents an error received from the D-Bus bus or from remote applications found in the bus. More...
#include <qdbuserror.h>
Public Types | |
enum | ErrorType { NoError = 0, Other = 1, Failed, NoMemory, ServiceUnknown, NoReply, BadAddress, NotSupported, LimitsExceeded, AccessDenied, NoServer, Timeout, NoNetwork, AddressInUse, Disconnected, InvalidArgs, UnknownMethod, TimedOut, InvalidSignature, UnknownInterface, InternalError, UnknownObject, InvalidService, InvalidObjectPath, InvalidInterface, InvalidMember } |
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementation and by the bus daemon itself, QDBusError can be compared to a set of pre-defined values: More... | |
Public Functions | |
bool | isValid () const |
Returns true if this is a valid error condition (i.e., if there was an error), otherwise false. More... | |
QString | message () const |
Returns the message that the callee associated with this error. More... | |
QString | name () const |
Returns this error's name. More... | |
QDBusError & | operator= (const QDBusError &other) |
QDBusError (const DBusError *error=0) | |
Constructs a QDBusError from a DBusError structure. More... | |
QDBusError (const QDBusMessage &msg) | |
Constructs a QDBusError from a QDBusMessage. More... | |
QDBusError (ErrorType error, const QString &message) | |
QDBusError (const QDBusError &other) | |
ErrorType | type () const |
Returns this error's ErrorType. More... | |
Static Public Functions | |
static QString | errorString (ErrorType error) |
Returns the error name associated with error condition error. More... | |
Properties | |
ErrorType | code |
QString | msg |
QString | nm |
void * | unused |
The QDBusError class represents an error received from the D-Bus bus or from remote applications found in the bus.
When dealing with the D-Bus bus service or with remote applications over D-Bus, a number of error conditions can happen. This error conditions are sometimes signalled by a returned error value or by a QDBusError.
C++ and Java exceptions are a valid analogy for D-Bus errors: instead of returning normally with a return value, remote applications and the bus may decide to throw an error condition. However, the QtDBus implementation does not use the C++ exception-throwing mechanism, so you will receive QDBusErrors in the return reply (see QDBusReply::error()).
QDBusError objects are used to inspect the error name and message as received from the bus and remote applications. You should not create such objects yourself to signal error conditions when called from D-Bus: instead, use QDBusMessage::createError() and QDBusConnection::send().
Definition at line 60 of file qdbuserror.h.
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementation and by the bus daemon itself, QDBusError can be compared to a set of pre-defined values:
e., the call succeeded)
org.freedesktop.DBus.Error.Failed
) org.freedesktop.DBus.Error.NoMemory
) org.freedesktop.DBus.Error.ServiceUnknown
) org.freedesktop.DBus.Error.NoReply
) org.freedesktop.DBus.Error.BadAddress
) org.freedesktop.DBus.Error.NotSupported
) org.freedesktop.DBus.Error.LimitsExceeded
) org.freedesktop.DBus.Error.AccessDenied
) org.freedesktop.DBus.Error.NoServer
) org.freedesktop.DBus.Error.Timeout
) org.freedesktop.DBus.Error.NoNetwork
) org.freedesktop.DBus.Error.AddressInUse
) org.freedesktop.DBus.Error.Disconnected
) org.freedesktop.DBus.Error.InvalidArgs
) org.freedesktop.DBus.Error.UnknownMethod
) org.freedesktop.DBus.Error.TimedOut
) org.freedesktop.DBus.Error.InvalidSignature
) com.trolltech.QtDBus.Error.InternalError
)Definition at line 63 of file qdbuserror.h.
QDBusError::QDBusError | ( | const DBusError * | error = 0 | ) |
Constructs a QDBusError from a DBusError structure.
Definition at line 255 of file qdbuserror.cpp.
QDBusError::QDBusError | ( | const QDBusMessage & | qdmsg | ) |
Constructs a QDBusError from a QDBusMessage.
Definition at line 273 of file qdbuserror.cpp.
Definition at line 288 of file qdbuserror.cpp.
QDBusError::QDBusError | ( | const QDBusError & | other | ) |
Definition at line 299 of file qdbuserror.cpp.
Returns the error name associated with error condition error.
Definition at line 368 of file qdbuserror.cpp.
Referenced by QDBusMessage::createError(), and QDBusMessage::createErrorReply().
bool QDBusError::isValid | ( | ) | const |
Returns true if this is a valid error condition (i.e., if there was an error), otherwise false.
Definition at line 356 of file qdbuserror.cpp.
Referenced by QDBusReply< QStringList >::isValid(), qDBusErrorToScriptValue(), QDBusInterfacePrivate::QDBusInterfacePrivate(), and qDBusReplyFill().
QString QDBusError::message | ( | ) | const |
Returns the message that the callee associated with this error.
Error messages are implementation defined and usually contain a human-readable error code, though this does not mean it is suitable for your end-users.
Definition at line 346 of file qdbuserror.cpp.
Referenced by QConnmanManagerInterface::connectService(), QDBusMessage::createError(), QDBusMessage::createErrorReply(), QConnmanManagerInterface::disableTechnology(), QConnmanManagerInterface::enableTechnology(), QConnmanManagerInterface::lookupService(), operator<<(), qDBusErrorToScriptValue(), QConnmanManagerInterface::registerCounter(), QDBusConnectionPrivate::relaySignal(), QConnmanManagerInterface::requestScan(), QDBusConnectionPrivate::send(), QOfonoSmsInterface::sendMessage(), QDBusConnectionPrivate::sendWithReply(), QDBusConnectionPrivate::sendWithReplyAsync(), and QConnmanManagerInterface::unregisterCounter().
QString QDBusError::name | ( | ) | const |
Returns this error's name.
Error names are similar to D-Bus Interface names, like org.freedesktop.DBus.InvalidArgs
.
Definition at line 335 of file qdbuserror.cpp.
Referenced by QDBusMessage::createError(), QDBusMessage::createErrorReply(), operator<<(), and qDBusErrorToScriptValue().
QDBusError & QDBusError::operator= | ( | const QDBusError & | other | ) |
Definition at line 309 of file qdbuserror.cpp.
QDBusError::ErrorType QDBusError::type | ( | ) | const |
Returns this error's ErrorType.
Definition at line 323 of file qdbuserror.cpp.
Referenced by QConnmanManagerInterface::disableTechnology(), QConnmanManagerInterface::enableTechnology(), QDBusConnectionPrivate::findMetaObject(), qDBusErrorToScriptValue(), QConnmanManagerInterface::registerCounter(), QConnmanManagerInterface::requestScan(), QOfonoSmsInterface::sendMessage(), and QConnmanManagerInterface::unregisterCounter().
|
private |
Definition at line 111 of file qdbuserror.h.
Referenced by isValid(), operator=(), QDBusError(), and type().
|
private |
Definition at line 112 of file qdbuserror.h.
Referenced by message(), operator=(), and QDBusError().
|
private |
Definition at line 113 of file qdbuserror.h.
Referenced by name(), operator=(), and QDBusError().
|
private |
Definition at line 114 of file qdbuserror.h.