Bug 40129 - Set a proper error if CM crashes
Summary: Set a proper error if CM crashes
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Will Thompson
QA Contact: Telepathy bugs list
URL:
Whiteboard: r+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-08-16 02:18 UTC by Guillaume Desmottes
Modified: 2011-09-13 05:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2011-08-16 02:18:10 UTC
During the very exciting Telepathy/GNOME BoF at desktop summit we noticed that killing a connected CM was raising an unknown error, leading to a not helpful message in Empathy and the Shell. MC could detect such error and popup a more useful error.
Comment 1 Guillaume Desmottes 2011-08-16 02:18:55 UTC
Assigning to Will as he volunteered to fix this. :)
Comment 2 Will Thompson 2011-09-13 04:45:15 UTC
Upon closer inspection, MC already does set a reasonable ConnectionError, namely org.freedesktop.DBus.NoReply (which is the closest error defined in either Telepathy or D-Bus itself (inasmuch as it's defined by D-Bus, given that it's not in the D-Bus specification (doh!))). It doesn't set debug-message, mainly because telepathy-glib does not: actually, there's no special handling in MC, it's just what happens inside tp-glib when the connection's bus name dies: the connection is invalidated, and as a result MC ends up calling tp_connection_get_detailed_error(), which guesses ConnectionError based on the GError:

      else if (proxy->invalidated->domain == TP_DBUS_ERRORS)
        {
          switch (proxy->invalidated->code)
            {
            case TP_DBUS_ERROR_NAME_OWNER_LOST:
              /* the CM probably crashed */
              return DBUS_ERROR_NO_REPLY;
              break;

TP_DBUS_ERROR_NAME_OWNER_LOST would be a closer match for “it crashed”, but as this code implicitly illustrates, it's not actually a D-Bus error name.

Here is an MC branch which does some cleanup and adds a test case for this situation: http://cgit.collabora.com/git/user/wjt/telepathy-mission-control-wjt.git/log/?h=fd.o-40129-set-a-proper-error-if-CM-crashes

And here is a little tp-glib tweak which makes it specify debug-message in this situation: http://cgit.collabora.com/git/user/wjt/telepathy-glib.git/commit/?h=fd.o-40129-set-debug-message-if-cm-crashes

Otherwise I think we get to go fix Empathy and the Shell…
Comment 3 Guillaume Desmottes 2011-09-13 05:08:06 UTC
(In reply to comment #2)
> Here is an MC branch which does some cleanup and adds a test case for this
> situation:
> http://cgit.collabora.com/git/user/wjt/telepathy-mission-control-wjt.git/log/?h=fd.o-40129-set-a-proper-error-if-CM-crashes

++

> And here is a little tp-glib tweak which makes it specify debug-message in this
> situation:
> http://cgit.collabora.com/git/user/wjt/telepathy-glib.git/commit/?h=fd.o-40129-set-debug-message-if-cm-crashes
> 
> Otherwise I think we get to go fix Empathy and the Shell…

++
Comment 4 Will Thompson 2011-09-13 05:18:10 UTC
Thanks, merged both branches and filed some Empathy patches over at <https://bugzilla.gnome.org/show_bug.cgi?id=658908>.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.