Show a nicer CommmandError in the management command for exceptions occurring during rendering.

This commit is contained in:
Jannis Leidel
2011-04-10 12:06:00 +02:00
parent b51130db59
commit 89f3d48ab5

View File

@@ -144,7 +144,11 @@ class Command(NoArgsCommand):
for nodes in compressor_nodes.values():
for node in nodes:
key = get_offline_cachekey(node.nodelist)
try:
result = node.render(context, forced=True)
except Exception, e:
raise CommandError("An error occured during rending: "
"%s" % e)
cache.set(key, result, settings.COMPRESS_OFFLINE_TIMEOUT)
results.append(result)
count += 1