Commit 36eb9509 by ichuang

inputtypes: if externalresponse server message is bad, don't crash

parent 6cc19de8
......@@ -232,7 +232,15 @@ def textbox(element, value, status, render_template, msg=''):
'rows':rows, 'cols':cols,
}
html = render_template("textbox.html", context)
return etree.XML(html)
try:
xhtml = etree.XML(html)
except Exception,err:
newmsg = 'error %s in rendering message' % (str(err).replace('<','&lt;'))
newmsg += '<br/>Original message: %s' % msg.replace('<','&lt;')
context['msg'] = newmsg
html = render_template("textbox.html", context)
xhtml = etree.XML(html)
return xhtml
#-----------------------------------------------------------------------------
@register_render_function
......
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