[Dextrose] (no subject)

Martin Abente martin.abente.lahaye at gmail.com
Thu Feb 10 22:17:21 EST 2011


>From 4fe8aae4307c9e153a3bb2a25214dfca0bb75676 Mon Sep 17 00:00:00 2001
From: Martin Abente <martin.abente.lahaye at gmail.com>
Date: Thu, 10 Feb 2011 22:22:21 -0300
Subject: [PATCH] Micro-format fix exception handler

The updater was blocking indefinitely due
to a unhandled exception and a missing method.

This patch mimics what aslo backend does in order
to maintain the same behaviour, when the updater
fails while fetching updates information.

NOTE TO AC: this patch does not solve the hostname
resolution problem.

Signed-off-by: Martin Abente <martin.abente.lahaye at gmail.com>
---
 .../cpsection/updater/backends/microformat.py      |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/extensions/cpsection/updater/backends/microformat.py b/extensions/cpsection/updater/backends/microformat.py
index 6abc185..c3c7268 100644
--- a/extensions/cpsection/updater/backends/microformat.py
+++ b/extensions/cpsection/updater/backends/microformat.py
@@ -24,6 +24,7 @@ import re
 import gio
 import gobject
 import gconf
+import traceback
 
 from jarabe import config
 
@@ -181,11 +182,10 @@ class _UpdateFetcher(gobject.GObject):
     def __read_async_cb(self, gfile, result):
         try:
             stream = gfile.read_finish(result)
-        except gio.Error, e:
-            self.stop()
-            logging.exception('Error while fetching content from %s' %
-                    self._url)
+        except:
+            self._completion_cb({}, traceback.format_exc())
             return
+
         stream.read_async(4096, self.__stream_read_cb)
 
     def __stream_read_cb(self, stream, result):
-- 
1.7.1



More information about the Dextrose mailing list