[evolution-data-server/gnome-3-8] Do not use generic error codes in camel_getaddrinfo()/camel_getnameinfo()



commit bab675f407535957467f385851175f2386b41cce
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 22 11:57:07 2013 +0200

    Do not use generic error codes in camel_getaddrinfo()/camel_getnameinfo()
    
    It's too hard to distinguish from other provider errors when using
    general error codes here, thus rather use CAMEL_SERVICE_ERROR_URL_INVALID.

 camel/camel-net-utils.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c
index 5165dc7..a83c847 100644
--- a/camel/camel-net-utils.c
+++ b/camel/camel-net-utils.c
@@ -41,6 +41,7 @@
 #endif
 #include "camel-object.h"
 #include "camel-operation.h"
+#include "camel-service.h"
 
 #define d(x)
 
@@ -728,11 +729,11 @@ camel_getaddrinfo (const gchar *name,
 
                if (msg->result == EAI_NONAME || msg->result == EAI_FAIL) {
                        g_set_error (
-                               error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
+                               error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID,
                                _("Host lookup '%s' failed. Check your host name for spelling errors."), 
name);
                } else if (msg->result != 0) {
                        g_set_error (
-                               error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
+                               error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID,
                                _("Host lookup '%s' failed: %s"),
                                name, gai_strerror (msg->result));
                }
@@ -881,11 +882,11 @@ camel_getnameinfo (const struct sockaddr *sa,
        result = msg->result;
        if (result == EAI_NONAME || result == EAI_FAIL) {
                g_set_error_literal (
-                       error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
+                       error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID,
                        _("Name lookup failed. Check your host name for spelling errors."));
        } else if (result) {
                g_set_error (
-                       error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
+                       error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID,
                        _("Name lookup failed: %s"), gai_strerror (result));
        } else {
                if (host)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]