From 038d5a1351bd604f98ea707f1b497c83fc5c50b0 Mon Sep 17 00:00:00 2001 From: Ari Rizzitano Date: Wed, 19 Jul 2017 15:22:54 -0400 Subject: [PATCH] catch WebpackLoaderBadStatsError to prevent unittest concurrency errors [LEARNER-1938] try also catching WebpackLoaderBadStatsError [LEARNER-1938] catch BaseWebpackLoaderException also do i need to import the exception? add better logging --- .../djangoapps/pipeline_mako/templates/static_content.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index 2b23ddbb06..e59b2636e3 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -93,6 +93,7 @@ source, template_path = Loader(engine).load_template_source(path) <% from django.template import Template, Context + from webpack_loader.exceptions import WebpackLoaderBadStatsError try: return Template(""" {% load render_bundle from webpack_loader %} @@ -105,9 +106,9 @@ source, template_path = Loader(engine).load_template_source(path) 'entry': entry, 'body': capture(caller.body) })) - except IOError as e: + except (IOError, WebpackLoaderBadStatsError) as e: # Don't break Mako template rendering if the bundle or webpack-stats can't be found, but log it - logger.error(e) + logger.error('[LEARNER-1938] {error}'.format(error=e)) %>