aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-08 03:26:50 +0800
committerDan Winship <danw@src.gnome.org>2000-04-08 03:26:50 +0800
commit5f93b830400c342ce0a20362df8d744120541478 (patch)
tree2f79c1f9cc92903397421156d3594d1e5c7d5509
parent7806215bdc77589af8488bf1d5db306864987b27 (diff)
downloadgsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar.gz
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar.bz2
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar.lz
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar.xz
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.tar.zst
gsoc2013-evolution-5f93b830400c342ce0a20362df8d744120541478.zip
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
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/providers/pop3/camel-pop3-store.c33
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 <danw@helixcode.com>
+
+ * providers/pop3/camel-pop3-store.c (pop3_connect): Clarify error
+ messages.
+ (finalize): fix a bug in camel_exception usage
+
2000-04-07 NotZed <NotZed@HelixCode.com>
* 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);