Skip to content

Commit

Permalink
catch invalid Clearsilver template lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rosbuild committed Aug 6, 2014
1 parent 354d7a4 commit ae3f1b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion parser/clearsilver.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ def format(self, formatter):
cs_template = Page(self.request, cs_template_page).getPageText()

hdf = neo_util.HDF()
hdf.readString(self.raw.encode('utf8'))
try:
hdf.readString(self.raw.encode('utf8'))
except Exception as ex:
import cgi
self.request.write(formatter.rawHTML('<span class="label label-danger">Exception Parsing Clearsilver: %s</span>' % cgi.escape(str(ex))))
return
hdf.setValue("Config.WhiteSpaceStrip", "0")

cs = neo_cs.CS(hdf)
Expand Down

0 comments on commit ae3f1b0

Please sign in to comment.