dbus-python and exceptions

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Apr 30 04:24:57 PDT 2007


On Mon, 30 Apr 2007 at 12:27:19 +0300, Eyal Ben David wrote:
> For clients that are not written in python (in my case C++), the python
> exception trace is meaningless.

The backtrace is not meaningful for the client in any case, since it's
from the perspective of the service - however, it does make debugging
*much* easier if the backtrace isn't just discarded. It's just a string
appended to the message - the receiving client doesn't parse it in any
way, even if the client is implemented in Python too.

One of my colleagues implemented this feature back in 2005 - it's
described in the git log as "_BEST_ _PATCH_ _EVER_" so clearly there was
some user demand to apply it! :-)

D-Bus exceptions are unlikely to be suitable for display to users
anyway, since they're not internationalized. In the Telepathy protocol
we treat the arguments as something for debugging only, and make sure the
exception name is specific enough to convey useful information to the
client.

One of my ongoing projects with dbus-python is to convert it to the
standard logging module. When I've done this, it might be more useful to
divert the backtraces to the service's log - this would require service
authors to set up the logging framework to log to a file or something
(since services' stderr is discarded), but they should probably be doing
that anyway.

	Simon


More information about the dbus mailing list