Re: Error code missing



Sergio Villar Senin wrote:
> Hi,
> 
> I found a place where the wrong error code was set. The
> camel_imap_message_cache_insert call was failing (in
> camel_imap_folder_fetch_data)due to a system IO error but the camel
> exception was not taking the right error code in that case. Find the
> patch attached.

And another related change. I think the errors while opening and storing
the summary files should be tagged as
CAMEL_EXCEPTION_SYSTEM_IO_WRITE/READ as the attached patch does.

Br
Index: libtinymail-camel/camel-lite/camel/camel-store-summary.c
===================================================================
--- libtinymail-camel/camel-lite/camel/camel-store-summary.c	(revision 3305)
+++ libtinymail-camel/camel-lite/camel/camel-store-summary.c	(working copy)
@@ -446,7 +446,7 @@
 	fd = g_open(tmp_path, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0600);
 
 	if (fd == -1) {
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_READ,
 			_("Error storing the store summary"));
 		io(printf("**  open error: %s\n", strerror (errno)));
 		CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
@@ -456,7 +456,7 @@
 
 	out = fdopen(fd, "wb");
 	if ( out == NULL ) {
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_READ,
 			_("Error storing the store summary"));
 		i = errno;
 		printf("**  fdopen error: %s\n", strerror (errno));
@@ -471,7 +471,7 @@
 
 
 	if ( ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_save(s, out) == -1) {
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE,
 			_("Error storing the store summary"));
 		i = errno;
 		fclose(out);
@@ -488,7 +488,7 @@
 	}
 
 	if (fflush (out) != 0 || fsync (fileno (out)) == -1) {
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE,
 			_("Error storing the store summary"));
 		i = errno;
 		fclose (out);
@@ -499,7 +499,7 @@
 	}
 
 	if (fclose (out) != 0) {
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE,
 			_("Error storing the store summary"));
 		CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
 		g_free (tmp_path);
@@ -512,7 +512,7 @@
 		i = errno;
 		g_unlink(tmp_path);
 		errno = i;
-		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+		camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE,
 			_("Error storing the store summary"));
 		CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
 		g_free (tmp_path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]