From af019dc03bac8bafb77b5cb4a98bdc17fd733b49 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Mon, 16 Jul 2001 18:06:35 +0000 Subject: Nicer error reporting. svn path=/trunk/; revision=11130 --- my-evolution/ChangeLog | 6 ++++++ my-evolution/e-summary-rdf.c | 14 ++++++++++---- my-evolution/e-summary-weather.c | 17 +++++++++++++++-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 9d203a1807..83a89e2dcb 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,9 @@ +2001-07-16 Iain Holmes + + * e-summary-rdf.c (display_doc): Nicer error reporting. + + * e-summary-weather.c: Nicer error reporting. + 2001-07-13 Iain Holmes * e-summary-tasks.c: Fix the name of the icon. diff --git a/my-evolution/e-summary-rdf.c b/my-evolution/e-summary-rdf.c index 954e03fc4a..5fed306fff 100644 --- a/my-evolution/e-summary-rdf.c +++ b/my-evolution/e-summary-rdf.c @@ -296,7 +296,7 @@ tree_walk (xmlNodePtr root, g_string_append (html, tmp); g_free (tmp); } - g_string_append (html, ""); + g_string_append (html, ""); } static void @@ -307,11 +307,16 @@ display_doc (RDF *r) html = g_string_new ("
"); - tree_walk (r->cache->root, r, html); + if (r->cache == NULL) { + g_string_append (html, _("There was an error downloading news feed
")); + } else { + tree_walk (r->cache->root, r, html); + } if (r->html != NULL) { g_free (r->html); } + g_string_append (html, "
"); r->html = html->str; g_string_free (html, FALSE); @@ -354,6 +359,7 @@ close_callback (GnomeVFSAsyncHandle *handle, } doc = xmlParseMemory (xml, strlen (xml)); +#if 0 if (doc == NULL) { if (r->html != NULL) { g_free (r->html); @@ -364,7 +370,7 @@ close_callback (GnomeVFSAsyncHandle *handle, g_free (xml); return; } - +#endif g_free (xml); r->cache = doc; @@ -412,7 +418,7 @@ open_callback (GnomeVFSAsyncHandle *handle, if (result != GNOME_VFS_OK) { r->html = e_utf8_from_locale_string (_("Error downloading RDF")); - e_summary_draw (r->summary); + display_doc (r); return; } diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index a2b3d5ffe3..597dee6325 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -34,6 +34,7 @@ struct _ESummaryWeather { guint32 timeout; gboolean online; + gboolean errorshown; }; static GHashTable *locations_hash = NULL; @@ -275,7 +276,12 @@ read_callback (GnomeVFSAsyncHandle *handle, Weather *w) { if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - w->html = g_strdup ("Error downloading RDF"); + if (w->summary->weather->errorshown == FALSE) { + w->html = g_strdup ("
An error occurred while downloading weather data
"); + w->summary->weather->errorshown = TRUE; + } else { + w->html = g_strdup ("
"); + } e_summary_draw (w->summary); w->handle = NULL; @@ -301,7 +307,13 @@ open_callback (GnomeVFSAsyncHandle *handle, Weather *w) { if (result != GNOME_VFS_OK) { - w->html = e_utf8_from_locale_string (_("Error downloading Metar")); + if (w->summary->weather->errorshown == FALSE) { + w->html = e_utf8_from_locale_string (_("
The weather server could not be contacted
")); + + w->summary->weather->errorshown = TRUE; + } else { + w->html = g_strdup ("
"); + } e_summary_draw (w->summary); return; @@ -319,6 +331,7 @@ e_summary_weather_update (ESummary *summary) { GList *w; + summary->weather->errorshown = FALSE; for (w = summary->weather->weathers; w; w = w->next) { char *uri; Weather *weather = w->data; -- cgit