Commit 038d5a13 by Ari Rizzitano

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
parent 3d610fd7
...@@ -93,6 +93,7 @@ source, template_path = Loader(engine).load_template_source(path) ...@@ -93,6 +93,7 @@ source, template_path = Loader(engine).load_template_source(path)
</%doc> </%doc>
<% <%
from django.template import Template, Context from django.template import Template, Context
from webpack_loader.exceptions import WebpackLoaderBadStatsError
try: try:
return Template(""" return Template("""
{% load render_bundle from webpack_loader %} {% load render_bundle from webpack_loader %}
...@@ -105,9 +106,9 @@ source, template_path = Loader(engine).load_template_source(path) ...@@ -105,9 +106,9 @@ source, template_path = Loader(engine).load_template_source(path)
'entry': entry, 'entry': entry,
'body': capture(caller.body) '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 # 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))
%> %>
</%def> </%def>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment