diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-11-03 15:34:17 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-11-03 15:34:17 (GMT) |
commit | e748f756c0d433349421fe613809bf5c6912e1ea (patch) | |
tree | 05e4b74abd3de9c1ca1476b281993800848162c4 /services | |
parent | bce1c9fa216ba5a36e4abdeda465bb2eefd7641e (diff) |
#4618: Make the shell service more resilient to failure.
Diffstat (limited to 'services')
-rw-r--r-- | services/shell/bundleregistry.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/services/shell/bundleregistry.py b/services/shell/bundleregistry.py index cbf5464..8dd141c 100644 --- a/services/shell/bundleregistry.py +++ b/services/shell/bundleregistry.py @@ -15,6 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os +import logging import gobject @@ -85,14 +86,22 @@ class BundleRegistry(gobject.GObject): for f in os.listdir(path): if not f.endswith('.activity'): continue - bundle_dir = os.path.join(path, f) - if os.path.isdir(bundle_dir): - bundles[bundle_dir] = os.stat(bundle_dir).st_mtime + try: + bundle_dir = os.path.join(path, f) + if os.path.isdir(bundle_dir): + bundles[bundle_dir] = os.stat(bundle_dir).st_mtime + except Exception, e: + logging.error('Error while processing installed activity ' \ + 'bundle: %s, %s, %s' % (f, e.__class__, e)) bundle_dirs = bundles.keys() bundle_dirs.sort(lambda d1,d2: cmp(bundles[d1], bundles[d2])) for dir in bundle_dirs: - self.add_bundle(dir) + try: + self.add_bundle(dir) + except Exception, e: + logging.error('Error while processing installed activity ' \ + 'bundle: %s, %s, %s' % (dir, e.__class__, e)) def add_bundle(self, bundle_path): try: |