imapx_command_start: Improve handling of write-to-stream error.
authorMatthew Barnes <mbarnes@redhat.com>
Sun, 28 Oct 2012 11:38:10 +0000 (07:38 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Sun, 28 Oct 2012 11:40:54 +0000 (07:40 -0400)
For some reason we were calling camel_stream_write_string() without
passing a GError, and on failure setting a very generic error message
and losing potentially useful information about the actual error.

camel/camel-imapx-server.c

index c15e53f..8845d90 100644 (file)
@@ -804,15 +804,11 @@ imapx_command_start (CamelIMAPXServer *is,
        string = g_strdup_printf (
                "%c%05u %s\r\n", is->tagprefix, ic->tag, cp->data);
        retval = camel_stream_write_string (
-               CAMEL_STREAM (stream), string, cancellable, NULL);
+               CAMEL_STREAM (stream), string, cancellable, error);
        g_free (string);
 
-       if (retval == -1) {
-               g_set_error (
-                       error, CAMEL_IMAPX_ERROR, 1,
-                       "Failed to issue the command");
+       if (retval == -1)
                goto err;
-       }
 
        while (is->literal == ic && cp_literal_plus) {
                /* Sent LITERAL+ continuation immediately */