def renderHTTP_exception(self, ctx, reason): _log.error('rendering exception: %s' % reason) request = inevow.IRequest(ctx) request.setResponseCode(http.INTERNAL_SERVER_ERROR) request.write("<html><head><title>Exception</title></head><body>") from nevow import failure result = failure.formatFailure(reason) request.write(''.join(flat.flatten(result))) request.write("</body></html>") request.finishRequest(False)
def renderHTTP_exception(self, ctx, reason): _log.error('rendering exception: %s' % reason) request = inevow.IRequest(ctx) request.setResponseCode(http.INTERNAL_SERVER_ERROR) request.write("<html><head><title>Exception</title></head><body>") from nevow import failure result = failure.formatFailure(reason) request.write(''.join(flat.flatten(result))) request.write("</body></html>") request.finishRequest( False )
def renderInlineException(self, context, reason): from nevow import failure formatted = failure.formatFailure(reason) desc = str(reason) return flat.serialize([ stan.xml("""<div style="border: 1px dashed red; color: red; clear: both" onclick="this.childNodes[1].style.display = this.childNodes[1].style.display == 'none' ? 'block': 'none'">"""), desc, stan.xml('<div style="display: none">'), formatted, stan.xml('</div></div>') ], context)
def renderInlineException(self, context, reason): from nevow import failure formatted = failure.formatFailure(reason) desc = str(reason) return flat.serialize([ stan.xml( """<div style="border: 1px dashed red; color: red; clear: both" onclick="this.childNodes[1].style.display = this.childNodes[1].style.display == 'none' ? 'block': 'none'">""" ), desc, stan.xml('<div style="display: none">'), formatted, stan.xml('</div></div>') ], context)