aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
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 /camel/providers
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
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c33
1 files changed, 22 insertions, 11 deletions
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);