Changeset 3280
- Timestamp:
- 01/20/08 15:12:13
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-exception-list.def (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-store.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (12 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (58 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c (modified) (7 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (29 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-local-store.c (modified) (5 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-local-summary.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-store.c (modified) (10 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-folder.c (modified) (21 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c (modified) (18 diffs)
- trunk/libtinymail-camel/tny-camel-account.c (modified) (6 diffs)
- trunk/libtinymail-camel/tny-camel-bs-msg-receive-strategy.c (modified) (4 diffs)
- trunk/libtinymail-camel/tny-camel-common-priv.h (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-common.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (44 diffs)
- trunk/libtinymail-camel/tny-camel-full-msg-receive-strategy.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-mime-part.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-nntp-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-nntp-store-account.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-partial-msg-receive-strategy.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-pop-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-pop-store-account.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-send-queue.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-store-account.c (modified) (18 diffs)
- trunk/libtinymail-camel/tny-camel-transport-account.c (modified) (7 diffs)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (3 diffs)
- trunk/libtinymail-maemo/tny-maemo-conic-device.c (modified) (3 diffs)
- trunk/libtinymail/tny-error.c (modified) (2 diffs)
- trunk/libtinymail/tny-error.h (modified) (4 diffs)
- trunk/libtinymail/tny-merge-folder.c (modified) (3 diffs)
- trunk/libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3279 r3280 1 2008-01-20 Philip Van Hoof <pvanhoof@gnome.org> 2 3 * Refactoring of all error reporting situations, errors and handling 4 of connection failures, reconnecting and getting messages in case of a 5 previous connection failure. 6 * Several bugfixes related to connection failures 7 * Several bugfixes related to connection problems when fetching 8 messages 9 * POP and IMAP now behave the same in case of connection problems 10 while fetching a message (they try to re-authenticate and re-connect) 11 * More finegrained error reporting (IO errors, SERVICE errors, SYSTEM 12 errors and unknown errors). 13 14 * This was a major API change for all modules 15 1 16 2008-01-19 Philip Van Hoof <pvanhoof@gnome.org> 2 17 trunk/libtinymail-camel/camel-lite/camel/camel-exception-list.def
r2815 r3280 14 14 CAMEL_EXCEPTION_USER_CANCEL, 15 15 16 CAMEL_EXCEPTION_SYSTEM_IO_WRITE, 17 CAMEL_EXCEPTION_SYSTEM_IO_READ, 18 CAMEL_EXCEPTION_SYSTEM_MEMORY, 19 16 20 /* CamelFolderException */ 17 21 CAMEL_EXCEPTION_FOLDER_NULL = 100, … … 21 25 CAMEL_EXCEPTION_FOLDER_NON_UID, 22 26 CAMEL_EXCEPTION_FOLDER_INSUFFICIENT_PERMISSION, 23 CAMEL_EXCEPTION_FOLDER_INVALID_PATH, 27 CAMEL_EXCEPTION_FOLDER_CREATE, 28 CAMEL_EXCEPTION_FOLDER_DELETE, 29 CAMEL_EXCEPTION_FOLDER_RENAME, 24 30 CAMEL_EXCEPTION_FOLDER_INVALID_UID, 31 CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 25 32 CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID, 33 26 34 27 35 /* CamelStoreException */ … … 37 45 CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, /* Authentication method not supported. */ 38 46 CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, 39 CAMEL_EXCEPTION_SERVICE_CERTIFICATE /* Certificate problems. */ 47 CAMEL_EXCEPTION_SERVICE_CERTIFICATE, /* Certificate problems. */ 48 CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, /* Network problem */ 49 CAMEL_EXCEPTION_SERVICE_PROTOCOL, /* Proto problem, like a BAD from IMAP */ 50 CAMEL_EXCEPTION_SERVICE_CONNECT, 51 CAMEL_EXCEPTION_SERVICE_NOT_SUPPORTED, trunk/libtinymail-camel/camel-lite/camel/camel-store.c
r3177 r3280 271 271 camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store)))); 272 272 273 camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_ INVALID,273 camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, 274 274 _("Cannot get folder: Invalid operation on this store")); 275 275 … … 368 368 camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store)))); 369 369 370 camel_exception_setv (ex, CAMEL_EXCEPTION_ STORE_INVALID,370 camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_CREATE, 371 371 _("Cannot create folder: Invalid operation on this store")); 372 372 … … 396 396 && (((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0) 397 397 || ((store->flags & CAMEL_STORE_VJUNK) && strcmp(folder_name, CAMEL_VJUNK_NAME) == 0))) { 398 camel_exception_setv(ex, CAMEL_EXCEPTION_ STORE_INVALID,398 camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_CREATE, 399 399 _("Cannot create folder: %s: folder exists"), folder_name); 400 400 return NULL; trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r3249 r3280 366 366 _("Operation cancelled")); 367 367 } else 368 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,368 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 369 369 g_strerror (errno)); 370 370 … … 418 418 return NULL; 419 419 } else 420 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,420 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 421 421 g_strerror (errno)); 422 422 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); … … 471 471 /* Connection was lost, no more data to fetch */ 472 472 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 473 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,473 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 474 474 _("Server unexpectedly disconnected: %s"), 475 475 _("Unknown error")); /* g_strerror (104)); FIXME after 1.0 is released */ … … 540 540 /* Connection was lost, no more data to fetch */ 541 541 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 542 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,542 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 543 543 _("Server unexpectedly disconnected: %s"), 544 544 _("Unknown error")); /* g_strerror (104)); FIXME after 1.0 is released */ … … 635 635 g_warning ("Unexpected response from IMAP server: %s", 636 636 respbuf); 637 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,637 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_PROTOCOL, 638 638 _("Unexpected response from IMAP " 639 639 "server: %s"), respbuf); … … 645 645 if (!*p++) 646 646 p = NULL; 647 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ INVALID,647 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_PROTOCOL, 648 648 _("IMAP command failed: %s"), 649 649 p ? p : _("Unknown error")); … … 715 715 camel_exception_clear (&mex); 716 716 } else { 717 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,717 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 718 718 g_strerror (errno)); 719 719 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); … … 735 735 camel_exception_clear (&mex); 736 736 } else { 737 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,737 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 738 738 _("Server response ended too soon.")); 739 739 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); … … 880 880 camel_exception_clear (&mex); 881 881 } else { 882 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,882 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 883 883 g_strerror (errno)); 884 884 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); … … 900 900 camel_exception_clear (&mex); 901 901 } else { 902 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,902 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 903 903 _("Server response ended too soon.")); 904 904 camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); … … 1116 1116 } else { 1117 1117 resp = NULL; 1118 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,1118 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_PROTOCOL, 1119 1119 _("IMAP server response did not contain " 1120 1120 "%s information"), type); … … 1152 1152 } 1153 1153 1154 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,1154 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_PROTOCOL, 1155 1155 _("Unexpected OK response from IMAP server: %s"), 1156 1156 response->status); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3279 r3280 297 297 298 298 if (e_util_mkdir_hier (folder_dir, S_IRWXU) != 0) { 299 camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM ,299 camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE, 300 300 _("Could not create directory %s: %s"), 301 301 folder_dir, g_strerror (errno)); … … 320 320 if (!folder->summary) { 321 321 camel_object_unref (CAMEL_OBJECT (folder)); 322 camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM ,322 camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM_IO_READ, 323 323 _("Could not load summary for %s"), 324 324 folder_name); … … 2685 2685 camel_object_unref (CAMEL_OBJECT (stream)); 2686 2686 if (ret == -1) { 2687 camel_exception_setv (ex, CAMEL_EXCEPTION_S ERVICE_UNAVAILABLE,2687 camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM_MEMORY, 2688 2688 _("Unable to retrieve message: %s"), 2689 2689 g_strerror (errno)); … … 2739 2739 if (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store)) == CAMEL_DISCO_STORE_OFFLINE) 2740 2740 { 2741 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,2741 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 2742 2742 _("This message is not currently available")); 2743 2743 goto fail; … … 2772 2772 if (!camel_disco_store_check_online ((CamelDiscoStore*)store, ex)) { 2773 2773 CAMEL_SERVICE_REC_UNLOCK(store, connect_lock); 2774 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,2774 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 2775 2775 _("This message is not currently available")); 2776 2776 goto fail; … … 4343 4343 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); 4344 4344 else 4345 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE,4345 camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_LOST_CONNECTION, 4346 4346 _("Server unexpectedly disconnected: %s"), 4347 4347 g_strerror (errno)); … … 4388 4388 gboolean amcon = FALSE; 4389 4389 4390 4390 4391 g_static_mutex_lock (&gmsgstore_lock); /* A */ 4391 4392 … … 4397 4398 } else 4398 4399 { 4400 4401 if (CAMEL_SERVICE (folder->parent_store)->status == CAMEL_SERVICE_DISCONNECTED) { 4402 CamelException tex = CAMEL_EXCEPTION_INITIALISER; 4403 camel_service_connect (CAMEL_SERVICE (folder->parent_store), &tex); 4404 if (camel_exception_is_set (&tex)) { 4405 camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 4406 _("This message is not currently available" 4407 " and can't go online to fetch it: %s"), 4408 camel_exception_get_description (&tex)); 4409 g_static_mutex_unlock (&gmsgstore_lock); 4410 camel_exception_clear (&tex); 4411 return NULL; 4412 } 4413 } 4414 4399 4415 store = CAMEL_IMAP_STORE (camel_object_new (CAMEL_IMAP_STORE_TYPE)); 4400 4416 imap_debug ("Get-Message service created\n"); … … 4416 4432 amcon = camel_service_connect (CAMEL_SERVICE (store), ex); 4417 4433 4418 if (!amcon || camel_exception_is_set (ex) || !camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex)) 4419 { 4434 if (!amcon || camel_exception_is_set (ex) || !camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex)) { 4420 4435 camel_object_unref (store); 4421 4436 if (!camel_exception_is_set (ex)) 4422 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,4437 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 4423 4438 _("This message is not currently available" 4424 " (can't let a new connection go online)"));4439 " and can't go online to fetch it")); 4425 4440 else if (camel_strstrcase (camel_exception_get_description (ex), "summary") != NULL) 4426 { 4427 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 4428 _("This message is not currently available" 4429 " and can't be retrieved due to insufficient " 4441 camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE, 4442 _("This message can't be retrieved due to insufficient " 4430 4443 " storage space resources.")); 4431 }4432 4444 4433 4445 CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock); … … 4507 4519 CamelImapFolder *imap_folder = (CamelImapFolder *) folder; 4508 4520 gchar *path = g_strdup_printf ("%s/%s_%s_CONVERTED", imap_folder->cache->path, uid, spec); 4509 gint ex_id ;4521 gint ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4510 4522 gboolean err = FALSE, found = FALSE; 4511 4523 gchar *err_message; … … 4521 4533 if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex)) { 4522 4534 4523 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,4535 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 4524 4536 _("This message is not currently available")); 4525 4537 g_free (path); … … 4540 4552 if (!fil || fd == -1) { 4541 4553 err = TRUE; 4542 ex_id = CAMEL_EXCEPTION_S ERVICE_UNAVAILABLE;4543 err_message = g_strdup_printf ( "Can't write %s", path);4554 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 4555 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 4544 4556 goto convert_errorhandler; 4545 4557 } … … 4590 4602 if (f > 1023 || nread <= 0) { 4591 4603 err = TRUE; 4592 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4593 err_message = g_strdup_printf ( "Read from service failed: Long "4594 " first line during binary fetch for uid=%s" , uid);4604 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4605 err_message = g_strdup_printf (_("Read from service failed: Long " 4606 " first line during binary fetch for uid=%s"), uid); 4595 4607 goto convert_berrorhander; 4596 4608 } … … 4602 4614 ptr += 3; 4603 4615 err = TRUE; 4604 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4616 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4605 4617 err_message = g_strdup_printf ("%s", 4606 ptr?ptr: "BAD from IMAP server while CONVERT");4618 ptr?ptr:_("BAD from IMAP server while CONVERT")); 4607 4619 store->capabilities &= ~IMAP_CAPABILITY_CONVERT; 4608 4620 goto convert_errorhandler; … … 4612 4624 { 4613 4625 err = TRUE; 4614 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4615 err_message = g_strdup_printf ( "Read from service failed: Line doesn't start "4616 " with \"* \" for uid=%s (in stead it started with %s)" , uid, line);4626 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4627 err_message = g_strdup_printf (_("Read from service failed: Line doesn't start " 4628 " with \"* \" for uid=%s (in stead it started with %s)"), uid, line); 4617 4629 goto convert_berrorhander; 4618 4630 } … … 4640 4652 { 4641 4653 err = TRUE; 4642 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4643 err_message = g_strdup_printf ( "Read from service failed: "4644 "strtol failed for uid=%s (the line was: %s)" , uid, line);4654 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4655 err_message = g_strdup_printf (_("Read from service failed: " 4656 "strtol failed for uid=%s (the line was: %s)"), uid, line); 4645 4657 goto convert_berrorhander; 4646 4658 } … … 4659 4671 { 4660 4672 err = TRUE; 4661 err_message = g_strdup_printf ("Write to cache failed: %s", g_strerror (errno)); 4673 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 4674 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 4662 4675 goto convert_berrorhander; 4663 4676 } … … 4667 4680 if (hread != 0) { 4668 4681 err = TRUE; 4669 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4670 err_message = g_strdup_printf ( "Read from service failed, UID=%s", uid);4682 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4683 err_message = g_strdup_printf (_("Read from service failed, UID=%s"), uid); 4671 4684 goto convert_berrorhander; 4672 4685 } … … 4688 4701 } else { 4689 4702 err = TRUE; 4690 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4691 err_message = g_strdup _printf ("CONVERT not supported on this server");4703 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4704 err_message = g_strdup (_("CONVERT not supported on this server")); 4692 4705 goto convert_errorhandler; 4693 4706 } … … 4712 4725 4713 4726 if (!err_message) 4714 camel_exception_setv (ex, ex_id, "Could not find message body in response.");4727 camel_exception_setv (ex, ex_id, _("Could not find message body in response")); 4715 4728 else { 4716 4729 camel_exception_setv (ex, ex_id, err_message); … … 4732 4745 gchar *path = g_strdup_printf ("%s/%s_%s", imap_folder->cache->path, uid, spec); 4733 4746 gboolean retry = TRUE; 4734 gint ex_id ;4747 gint ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4735 4748 gboolean err = FALSE, found = FALSE; 4736 4749 gchar *err_message; … … 4763 4776 if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex)) { 4764 4777 4765 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,4778 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 4766 4779 _("This message is not currently available")); 4767 4780 g_free (path); … … 4787 4800 if (!fil || fd == -1) { 4788 4801 err = TRUE; 4789 ex_id = CAMEL_EXCEPTION_S ERVICE_UNAVAILABLE;4790 err_message = g_strdup_printf ( "Can't write %s", path);4802 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 4803 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 4791 4804 goto fetch_errorhandler; 4792 4805 } … … 4840 4853 if (f > 1023 || nread <= 0) { 4841 4854 err = TRUE; 4842 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4843 err_message = g_strdup_printf ( "Read from service failed: Long "4844 " first line during binary fetch for uid=%s" , uid);4855 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4856 err_message = g_strdup_printf (_("Read from service failed: Long " 4857 " first line during binary fetch for uid=%s"), uid); 4845 4858 goto fetch_berrorhander; 4846 4859 } … … 4864 4877 { 4865 4878 err = TRUE; 4866 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4867 err_message = g_strdup_printf ( "Read from service failed: Line doesn't start "4868 " with \"* \" for uid=%s (in stead it started with %s)" , uid, line);4879 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4880 err_message = g_strdup_printf (_("Read from service failed: Line doesn't start " 4881 " with \"* \" for uid=%s (in stead it started with %s)"), uid, line); 4869 4882 goto fetch_berrorhander; 4870 4883 } … … 4892 4905 { 4893 4906 err = TRUE; 4894 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4895 err_message = g_strdup_printf ( "Read from service failed: "4896 "strtol failed for uid=%s (the line was: %s)" , uid, line);4907 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4908 err_message = g_strdup_printf (_("Read from service failed: " 4909 "strtol failed for uid=%s (the line was: %s)"), uid, line); 4897 4910 goto fetch_berrorhander; 4898 4911 } … … 4911 4924 { 4912 4925 err = TRUE; 4913 err_message = g_strdup_printf ("Write to cache failed: %s", g_strerror (errno)); 4926 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 4927 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 4914 4928 goto fetch_berrorhander; 4915 4929 } … … 4919 4933 if (hread != 0) { 4920 4934 err = TRUE; 4921 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4922 err_message = g_strdup_printf ( "Read from service failed, UID=%s", uid);4935 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4936 err_message = g_strdup_printf (_("Read from service failed, UID=%s"), uid); 4923 4937 goto fetch_berrorhander; 4924 4938 } … … 4975 4989 if (!server_stream) { 4976 4990 err = TRUE; 4977 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;4978 err_message = g_strdup ( "Read from service failed: Service unavailable");4991 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 4992 err_message = g_strdup (_("Read from service failed: Service unavailable")); 4979 4993 } else 4980 4994 store->command++; … … 5000 5014 if (linenum == 0 && (line [0] != '*' || line[1] != ' ')) 5001 5015 { 5002 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;5003 err_message = g_strdup ( "Read from service failed: Unexpected result from service");5016 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 5017 err_message = g_strdup (_("Read from service failed: Unexpected result from service")); 5004 5018 err=TRUE; 5005 5019 break; … … 5031 5045 { 5032 5046 err = TRUE; 5033 err_message = g_strdup_printf ("Write to cache failed: %s", g_strerror (errno)); 5047 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 5048 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 5034 5049 break; 5035 5050 } … … 5038 5053 { 5039 5054 err = TRUE; 5040 err_message = g_strdup_printf ("Write to cache failed: %s", g_strerror (errno)); 5055 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 5056 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 5041 5057 break; 5042 5058 } … … 5050 5066 if (write (fd, line, llen) != llen) { 5051 5067 err = TRUE; 5052 err_message = g_strdup_printf ("Write to cache failed: %s", g_strerror (errno)); 5068 ex_id = CAMEL_EXCEPTION_SYSTEM_IO_WRITE; 5069 err_message = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 5053 5070 break; 5054 5071 } … … 5067 5084 if (nread <= 0) { 5068 5085 err = TRUE; 5069 ex_id = CAMEL_EXCEPTION_SERVICE_ UNAVAILABLE;5070 err_message = g_strdup_printf ( "Read from service failed: %s", g_strerror (errno));5086 ex_id = CAMEL_EXCEPTION_SERVICE_PROTOCOL; 5087 err_message = g_strdup_printf (_("Read from service failed: %s"), g_strerror (errno)); 5071 5088 } 5072 5089 … … 5107 5124 5108 5125 if (!err_message) 5109 camel_exception_setv (ex, ex_id, "Could not find message body in response.");5126 camel_exception_setv (ex, ex_id, _("Could not find message body in response")); 5110 5127 else { 5111 5128 camel_exception_setv (ex, ex_id, err_message); … … 5170 5187 5171 5188 if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex)) { 5172 camel_exception_set (ex, CAMEL_EXCEPTION_ SERVICE_UNAVAILABLE,5189 camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_UID_NOT_AVAILABLE, 5173 5190 _("This message is not currently available")); 5174 5191 } else { … … 5193 5210 "UID FETCH %s BODYSTRUCTURE", uid); 5194 5211 5195 for (i = 0; i < response->untagged->len; i++) 5196 { 5197 resp = ((char*)response->untagged->pdata[i]) + 2; 5198 walk_the_string (resp, bodyst); 5212 if (response) { 5213 for (i = 0; i < response->untagged->len; i++) { 5214 resp = ((char*)response->untagged->pdata[i]) + 2; 5215 walk_the_string (resp, bodyst); 5216 } 5217 5218 camel_imap_response_free (store, response); 5219 5220 retval = bodyst->str; 5221 g_string_free (bodyst, FALSE); 5222 } else { 5223 camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_PROTOCOL, 5224 _("Failure fetchting BODYSTRUCTURE from IMAP server")); 5225 g_string_free (bodyst, TRUE); 5226 retval = NULL; 5199 5227 } 5200 5201 camel_imap_response_free (store, response);5202 5203 retval = bodyst->str;5204 g_string_free (bodyst, FALSE);5205 5228 5206 5229 stop_gmsgstore (imap_folder, ctchecker, FALSE); … … 5214 5237 fputs (retval, file); 5215 5238 fclose (file); 5239 } else { 5240 gchar *mss = g_strdup_printf (_("Write to cache failed: %s"), g_strerror (errno)); 5241 camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM_IO_WRITE, mss); 5242 g_free (mss); 5216 5243 } 5217 5244 } … … 5266 5293 if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->paren
