[Telepathy-commits] [telepathy-glib/master] tp_g_set_error_invalid_handle_type, _unsupported_handle_type: raise NotImplemented

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Jan 16 08:40:00 PST 2009


It makes little sense to try to distinguish between "this CM does
not implement the requested operation for this handle type" and
"this CM has never heard of this handle type", since the number of
handle types that exist can change at any time.
---
 telepathy-glib/errors.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/telepathy-glib/errors.c b/telepathy-glib/errors.c
index d103dd3..7fe9186 100644
--- a/telepathy-glib/errors.c
+++ b/telepathy-glib/errors.c
@@ -37,14 +37,17 @@
  * @type: An invalid handle type
  * @error: Either %NULL, or used to return an error (as for g_set_error)
  *
- * Set the error InvalidArgument corresponding to an invalid handle type,
+ * Set the error NotImplemented for an invalid handle type,
  * with an appropriate message.
+ *
+ * Changed in version 0.7.UNRELEASED: previously, the error was
+ * InvalidArgument.
  */
 void
 tp_g_set_error_invalid_handle_type (guint type, GError **error)
 {
-  g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
-      "invalid handle type %u", type);
+  g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+      "unsupported handle type %u", type);
 }
 
 /**
@@ -52,16 +55,16 @@ tp_g_set_error_invalid_handle_type (guint type, GError **error)
  * @type: An unsupported handle type
  * @error: Either %NULL, or used to return an error (as for g_set_error)
  *
- * Set the error InvalidArgument for a handle type which is valid but is not
+ * Set the error NotImplemented for a handle type which is valid but is not
  * supported by this connection manager, with an appropriate message.
  *
- * FIXME: Shouldn't the error be NotImplemented? The spec doesn't always
- * allow us to return that, though.
+ * Changed in version 0.7.UNRELEASED: previously, the error was
+ * InvalidArgument.
  */
 void
 tp_g_set_error_unsupported_handle_type (guint type, GError **error)
 {
-  g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+  g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
       "unsupported handle type %u", type);
 }
 
-- 
1.5.6.5



More information about the Telepathy-commits mailing list