diff options
author | Peter Williams <peterw@ximian.com> | 2001-07-18 05:22:20 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-07-18 05:22:20 +0800 |
commit | e8aa23866a44d1d93750f42a9c168bcd007eb7bb (patch) | |
tree | 7b112db0933f469ce7c8d3fa5089f9fc363729a1 /camel/camel-remote-store.c | |
parent | bbfb9268af8e5d8c5a0ac346ba13efc00783d46c (diff) | |
download | gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.gz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.bz2 gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.lz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.xz gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.tar.zst gsoc2013-evolution-e8aa23866a44d1d93750f42a9c168bcd007eb7bb.zip |
Clean up some exception misusage.
2001-07-17 Peter Williams <peterw@ximian.com>
Clean up some exception misusage.
* providers/imap/camel-imap-command.c (camel_imap_command): Use
our own internal exception for sending the string and transfer it
to @ex if anything goes wrong.
(imap_read_response): Use our own internal exception for reading
the untagged responses and blah blah blah.
* camel-session.c (get_service): Use our own internal exception
when constructing the service and transfer it to @ex if anything
goes wrong.
* camel-remote-store.c (remote_recv_line): Instead of having
gboolean exception, use our own internal exception and copy
it to @ex if anything goes wrong.
* camel-store.c (store_sync): Create an internal exception
because sync_folder() checks it for validity. Transfer it to
@ex when done.
* camel-exception.c (camel_exception_get_description): If @ex is
NULL, complain - passing NULL exceptions to Camel is okay, but
there should be no circumstances under which they're then
examined.
(camel_exception_get_id): Same here,
(camel_exception_xfer): NULL-protect and warn if transferring from
a NULL exception.
svn path=/trunk/; revision=11177
Diffstat (limited to 'camel/camel-remote-store.c')
-rw-r--r-- | camel/camel-remote-store.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 823a4673f4..aca833f7f0 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -453,7 +453,7 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex) CamelStreamBuffer *stream; GByteArray *bytes; gchar buf[1024], *ret; - gboolean exception = FALSE; + CamelException internal_ex; gint nread; *dest = NULL; @@ -478,18 +478,18 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex) g_byte_array_append (bytes, buf, nread); } while (nread == sizeof (buf) - 1); + camel_exception_init (&internal_ex); if (nread == -1) { - exception = TRUE; if (errno == EINTR) - camel_exception_set(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); + camel_exception_set(&internal_ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); else - camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, strerror(errno)); - } else if (bytes->len == 0) { - exception = TRUE; - camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, + camel_exception_set(&internal_ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, strerror(errno)); + } else if (bytes->len == 0) + camel_exception_set(&internal_ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, _("Server unexpectedly disconnected")); - } - if (camel_exception_is_set (ex) || exception) { + + if (camel_exception_is_set (&internal_ex)) { + camel_exception_xfer (ex, &internal_ex); g_byte_array_free(bytes, TRUE); camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); return -1; |