'Print information from a failure or error to the supplied stream.'

def _print_error_text(self, stream, tagname, error):

    text = escape(str(error[1]))
    stream.write(('%s:    %s\n' % (tagname.upper(), text)))
    tb_stream = StringIO()
    traceback.print_tb(error[2], None, tb_stream)
    stream.write(escape(tb_stream.getvalue()))
    stream.write((('-' * 80) + '\n'))
