diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-09-15 23:37:58 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-09-15 23:37:58 (GMT) |
commit | c2695207053d221c24cc2589e6a6589f6b6c26c9 (patch) | |
tree | 99d9cd90230709ce9341940b80bcd4071fbf1fc3 | |
parent | da3e813ae1d1bd96334595fd4738be63ae250b82 (diff) |
Fail gently on bad bundles #1359
-rw-r--r-- | src/jarabe/journal/misc.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py index e6e5abf..5ea1d24 100644 --- a/src/jarabe/journal/misc.py +++ b/src/jarabe/journal/misc.py @@ -16,7 +16,6 @@ import logging import time -import traceback import os from gettext import gettext as _ @@ -28,7 +27,6 @@ from sugar.graphics.icon import get_icon_file_name from sugar import mime from sugar.bundle.activitybundle import ActivityBundle from sugar.bundle.contentbundle import ContentBundle -from sugar.bundle.bundle import MalformedBundleException from sugar import util from jarabe.model import bundleregistry @@ -69,8 +67,7 @@ def get_icon_name(metadata): bundle = ActivityBundle(file_path) file_name = bundle.get_icon() except Exception: - logging.warning('Could not read bundle:\n' + \ - traceback.format_exc()) + logging.exception('Could not read bundle') if file_name is None: file_name = _get_icon_for_mime(metadata.get('mime_type', '')) @@ -115,8 +112,8 @@ def get_bundle(metadata): return JournalEntryBundle(file_path) else: return None - except MalformedBundleException, e: - logging.warning('Incorrect bundle: %r', e) + except Exception: + logging.exception('Incorrect bundle') return None def _get_activities_for_mime(mime_type): |