From b17836f2325cb3a9bdfb3eebd62ba2e8b3a9c2c6 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 12 Oct 2012 12:27:21 -0400 Subject: [PATCH 1/2] swallow exceptions when generating thumbnails --- common/lib/xmodule/xmodule/contentstore/content.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/contentstore/content.py b/common/lib/xmodule/xmodule/contentstore/content.py index 7e70ced08e..d11c271ccc 100644 --- a/common/lib/xmodule/xmodule/contentstore/content.py +++ b/common/lib/xmodule/xmodule/contentstore/content.py @@ -128,7 +128,7 @@ class ContentStore(object): contentstore().save(thumbnail_content) except: - raise + pass # thumbnails are ultimately optional return thumbnail_content From d31a7c6d6ba9fe6fa9d8e67cb5b71d366829f2c7 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 12 Oct 2012 13:11:55 -0400 Subject: [PATCH 2/2] log and continue on thumbnail generation exception --- common/lib/xmodule/xmodule/contentstore/content.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/contentstore/content.py b/common/lib/xmodule/xmodule/contentstore/content.py index d11c271ccc..6dcf70fbe1 100644 --- a/common/lib/xmodule/xmodule/contentstore/content.py +++ b/common/lib/xmodule/xmodule/contentstore/content.py @@ -127,8 +127,10 @@ class ContentStore(object): 'image/jpeg', thumbnail_file) contentstore().save(thumbnail_content) - except: - pass # thumbnails are ultimately optional + + except Exception, e: + # log and continue as thumbnails are generally considered as optional + logging.exception("Failed to generate thumbnail for {0}. Exception: {1}".format(content.location, str(e))) return thumbnail_content