summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2016-09-02 14:30:12 -0500
committerRyan S. Arnold <ryan.arnold@linaro.org>2016-09-02 14:30:12 -0500
commitfefa752922c71211f168badc591f8873fdb19e49 (patch)
tree56c9bbd8e0bde70a419af918c0d1942e8695b8bb
parent0c5d8bc08c904bde1547773cbd52f56aaa599116 (diff)
rn.py: If jinja can't generate output, print exception and let user fix template.
-rw-r--r--rn.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/rn.py b/rn.py
index fd362e4..fa87790 100644
--- a/rn.py
+++ b/rn.py
@@ -24,6 +24,9 @@ from linaropy.rn.rnseries import RNSeries
from linaropy.rn.rngen import rngen
from linaropy.rninput import yninput
+from jinja2.exceptions import TemplateSyntaxError
+import traceback
+
rnProj=[]
# Cleanup the temporary project directory if necessary.
@@ -90,7 +93,12 @@ def generate(track, to_date, to_series, gccsource, persist):
# Generate the temporary output files to the projdir.
with cd(rnProj[0].projdir):
- rngen(next_rn, gccclone)
+ try:
+ rngen(next_rn, gccclone)
+ except TemplateSyntaxError:
+ traceback.print_exc(file=sys.stdout)
+ print "Please correct the template and try again."
+ continue
print "Please direct your browser to the rendered .html files in"
print "%s and make sure that they look correct." % rnProj[0].projdir