Summary: | [0.11] Make better use of telepathy-spec 0.17.27 errors | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Simon McVittie <smcv> |
Component: | tp-glib | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/even-better-errors | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: | ||
Bug Depends on: | 24116, 27967 | ||
Bug Blocks: |
Description
Simon McVittie
2009-08-17 11:01:50 UTC
Not suitable for changing in a stable branch, in any case. I finished off the branch as smcv/better-errors, and added another, smcv/even-better-errors. The former is relatively safe, the latter less so. I can divide the better-errors branch up into 3 parts (TpBaseConnection, TpConnection, TpChannel Group) and get them reviewed separately, if one turns out to be controversial. Branches on the way in a moment (currently rebasing, since there were changes in the tests that are likely to conflict). TpBaseConnection ================ When #TpBaseConnectionClass.start_connecting fails, any GError it yields is turned into a Connection_Status_Reason. I just added some more cases. This should be uncontroversial. TpConnection ============ Old: * Network_Error, "...ConnectionFailed" -> TP_ERROR_CONNECTION_FAILED * Network_Error, "com.example.NoNetworkCoverage" -> TP_DBUS_ERROR_REMOTE_ERROR New: * Network_Error, "...ConnectionFailed" -> TP_ERROR_CONNECTION_FAILED * Network_Error, "com.example.NoNetworkCoverage" -> TP_ERROR_NETWORK_ERROR This also adds a function tp_connection_get_detailed_error(), which gets the ConnectionError arguments (if that signal was emitted) or a D-Bus error string chosen based on the invalidation reason (otherwise), and is necessary for Bug #21120. TpChannel Group (in better-errors) ================================== This changes the TpProxy::invalidated error if a D-Bus error string is seen in the "error" detail of MembersChangedDetailed. Previously, we used the Channel_Group_Change_Reason to construct an error in TP_ERRORS_REMOVED_FROM_GROUP; now, we use the "error", if recognised. If the "error" is not recognised, we still fall back to the Channel_Group_Change_Reason. Old: * Error, "...ConnectionFailed" -> domain=TP_ERRORS_REMOVED_FROM_GROUP, code=TP_CHANNEL_GROUP_CHANGE_REASON_ERROR * Error, "com.example.NoNetworkCoverage" -> domain=TP_ERRORS_REMOVED_FROM_GROUP, code=TP_CHANNEL_GROUP_CHANGE_REASON_ERROR New: * Error, "...ConnectionFailed" -> TP_ERROR_CONNECTION_FAILED * Error, "com.example.NoNetworkCoverage" -> domain=TP_ERRORS_REMOVED_FROM_GROUP, code=TP_CHANNEL_GROUP_CHANGE_REASON_ERROR TpChannel Group (in even-better-errors) ======================================= This additionally changes the behaviour of TpChannel's TpProxy::invalidated when there isn't an "error", or it isn't recognised. Instead of encoding the Channel_Group_Change_Reason into TP_ERRORS_REMOVED_FROM_GROUP, it's now encoded into TP_ERRORS, whenever possible, which makes TP_ERRORS_REMOVED_FROM_GROUP mostly obsolete. As a special case, Channel_Group_Change_Reason_Error turns into the NotAvailable error code (I could change this if someone has a better idea). Old: * Kicked -> domain=TP_ERRORS_REMOVED_FROM_GROUP, code=TP_CHANNEL_GROUP_CHANGE_REASON_KICKED * Error, "com.example.NoNetworkCoverage" -> domain=TP_ERRORS_REMOVED_FROM_GROUP, code=TP_CHANNEL_GROUP_CHANGE_REASON_ERROR New: * Kicked -> TP_ERROR_CHANNEL_KICKED * Error, "com.example.NoNetworkCoverage" -> TP_ERROR_NOT_AVAILABLE Sorry, I meant Bug #21200 rather than Bug #21120. http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/better-errors which is a prefix of: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/even-better-errors It seems (from `git grep TP_ERROR`) that this won't impact Empathy at all, since Empathy does virtually nothing with errors. :'-( better-errors looks good to me. Didn't review even-better-errors yet. I've merged most of better-errors; because even-better-errors hasn't been reviewed yet, I omitted the changes to TpChannel (I think if we're going to make changes to TpChannel's error behaviour, they should all land at once, so I'd like even-better-errors either accepted or rejected before merging the rest). Looks good to me. I've updated the branch with some text for NEWS. Merge is blocked by Bug #27967. r+ from wjt for the NEWS, merging. Fixed in git for 0.11.5 |
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.