From 5f93b830400c342ce0a20362df8d744120541478 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 7 Apr 2000 19:26:50 +0000 Subject: Clarify error messages. (finalize): fix a bug in camel_exception usage * providers/pop3/camel-pop3-store.c (pop3_connect): Clarify error messages. (finalize): fix a bug in camel_exception usage svn path=/trunk/; revision=2329 --- camel/ChangeLog | 6 ++++++ camel/providers/pop3/camel-pop3-store.c | 33 ++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index a514f14c9a..9807aa6242 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2000-04-07 Dan Winship + + * providers/pop3/camel-pop3-store.c (pop3_connect): Clarify error + messages. + (finalize): fix a bug in camel_exception usage + 2000-04-07 NotZed * providers/Makefile.am: Removed smtp for now, its a long way from diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index b63cd30342..933e455c42 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -134,7 +134,7 @@ finalize (GtkObject *object) camel_exception_init (&ex); pop3_disconnect (CAMEL_SERVICE (object), &ex); - camel_exception_free (&ex); + camel_exception_clear (&ex); } @@ -289,19 +289,30 @@ pop3_connect (CamelService *service, CamelException *ex) } if (status != CAMEL_POP3_OK ) { - status = camel_pop3_command(store, NULL, "USER %s", + char *msg; + + status = camel_pop3_command(store, &msg, "USER %s", service->url->user); - if (status == CAMEL_POP3_OK) { - status = camel_pop3_command(store, NULL, - "PASS %s", pass); + if (status != CAMEL_POP3_OK) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + "Unable to connect to POP " + "server. Error sending username:" + " %s", msg ? msg : "(Unknown)"); + g_free (msg); + g_free (pass); + return FALSE; } - } - if (status != CAMEL_POP3_OK) { - camel_exception_set (ex, - CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - "Unable to authenticate to POP server."); - return FALSE; + status = camel_pop3_command(store, &msg, "PASS %s", pass); + if (status != CAMEL_POP3_OK) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + "Unable to authenticate to POP " + "server. Error sending password:" + " %s", msg ? msg : "(Unknown)"); + g_free (msg); + g_free (pass); + return FALSE; + } } g_free (pass); -- cgit v1.2.3