Use g_strerror when setting an exception string (we need it to be in
2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_message_simple): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use g_strerror when setting an exception string (we need it to be in UTF-8). (pop3_get_message): Same. svn path=/trunk/; revision=18690
This commit is contained in:
committed by
Jeffrey Stedfast
parent
3eabd14ace
commit
e1ef0a9ced
@ -1,5 +1,18 @@
|
||||
2002-11-11 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
* providers/imap/camel-imap-folder.c (get_message_simple): Use
|
||||
g_strerror when setting an exception string (we need it to be in
|
||||
UTF-8).
|
||||
|
||||
* providers/pop3/camel-pop3-store.c (pop3_try_authenticate): Use
|
||||
g_strerror when setting an exception string (we need it to be in
|
||||
UTF-8).
|
||||
|
||||
* providers/pop3/camel-pop3-folder.c (pop3_refresh_info): Use
|
||||
g_strerror when setting an exception string (we need it to be in
|
||||
UTF-8).
|
||||
(pop3_get_message): Same.
|
||||
|
||||
* providers/local/camel-spool-summary.c (spool_summary_sync_full):
|
||||
Use g_strerror when setting an exception string (we need it to be
|
||||
in UTF-8).
|
||||
|
||||
@ -448,9 +448,11 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
|
||||
nread = camel_stream_read (store->istream, str->str + 1, length);
|
||||
if (nread == -1) {
|
||||
if (errno == EINTR)
|
||||
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));
|
||||
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
|
||||
_("Operation cancelled"));
|
||||
else
|
||||
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, g_strerror (errno));
|
||||
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
|
||||
g_strerror (errno));
|
||||
camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
|
||||
g_string_free (str, TRUE);
|
||||
goto lose;
|
||||
|
||||
@ -1869,7 +1869,8 @@ get_message_simple (CamelImapFolder *imap_folder, const char *uid,
|
||||
camel_object_unref (CAMEL_OBJECT (stream));
|
||||
if (ret == -1) {
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
|
||||
_("Unable to retrieve message: %s"), strerror(errno));
|
||||
_("Unable to retrieve message: %s"),
|
||||
g_strerror (errno));
|
||||
camel_object_unref (CAMEL_OBJECT (msg));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -261,7 +261,9 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex)
|
||||
if (errno == EINTR)
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
|
||||
else
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get POP summary: %s"), strerror(errno));
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||
_("Cannot get POP summary: %s"),
|
||||
g_strerror (errno));
|
||||
}
|
||||
|
||||
/* TODO: check every id has a uid & commands returned OK too? */
|
||||
@ -426,7 +428,9 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
|
||||
if (fi->err == EINTR)
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
|
||||
else
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(fi->err));
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||
_("Cannot get message %s: %s"),
|
||||
uid, g_strerror (fi->err));
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@ -485,12 +489,13 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
|
||||
if (fi->err == EINTR)
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
|
||||
else
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(fi->err));
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||
_("Cannot get message %s: %s"),
|
||||
uid, g_strerror (fi->err));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (camel_stream_read(stream, buffer, 1) != 1
|
||||
|| buffer[0] != '#') {
|
||||
if (camel_stream_read(stream, buffer, 1) != 1 || buffer[0] != '#') {
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
|
||||
_("Cannot get message %s: %s"), uid, _("Unknown reason"));
|
||||
goto done;
|
||||
@ -502,7 +507,9 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
|
||||
if (errno == EINTR)
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("User cancelled"));
|
||||
else
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), uid, strerror(errno));
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||
_("Cannot get message %s: %s"),
|
||||
uid, g_strerror (errno));
|
||||
camel_object_unref((CamelObject *)message);
|
||||
message = NULL;
|
||||
}
|
||||
|
||||
@ -513,9 +513,10 @@ pop3_try_authenticate (CamelService *service, const char *errmsg,
|
||||
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled"));
|
||||
} else {
|
||||
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
|
||||
_("Unable to connect to POP server %s.\nError sending password: %s"),
|
||||
_("Unable to connect to POP server %s.\n"
|
||||
"Error sending password: %s"),
|
||||
CAMEL_SERVICE (store)->url->host,
|
||||
errno ? strerror (errno) : _("Unknown error"));
|
||||
errno ? g_strerror (errno) : _("Unknown error"));
|
||||
}
|
||||
} else if (pcp->state != CAMEL_POP3_COMMAND_OK)
|
||||
camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
|
||||
|
||||
@ -64,7 +64,7 @@ stream_fill(CamelPOP3Stream *is)
|
||||
is->end[0] = '\n';
|
||||
return is->end - is->ptr;
|
||||
} else {
|
||||
dd(printf("POP3_STREAM_FILL(ERROR): '%s'\n", strerror(errno)));
|
||||
dd(printf("POP3_STREAM_FILL(ERROR): '%s'\n", strerror (errno)));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user