Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
except etree.LxmlError as e:
if not(debug_mode):
raise
error_log = e.error_log
runtrace = True
if runtrace:
from diazo.runtrace import generate_debug_html
# Add debug information to end of body
body = result.tree.xpath('/html/body')[0]
debug_url = findContext(
self.request
).portal_url() + '/++resource++diazo-debug'
body.insert(
-1,
generate_debug_html(
debug_url,
rules=settings.rules,
rules_parser=getParser('rules', settings.readNetwork),
error_log=error_log,
)
)
return result