This method copies the code from pywsgi.WSGIHandler.handle_error,
        change the write part to be a reflection of traceback and environ

def handle_error(self, type_, value, tb):
        """This method copies the code from pywsgi.WSGIHandler.handle_error,
        change the write part to be a reflection of traceback and environ
        """
        if not issubclass(type_, pywsgi.GreenletExit):
            self.server.loop.handle_error(self.environ, type_, value, tb)
        if self.response_length:
            self.close_connection = True
        else:
            tb_stream = traceback.format_exception(type_, value, tb)
            del tb
            tb_stream.append('\n')
            tb_stream.append(pprint.pformat(self.environ))
            body = ''.join(tb_stream)
            headers = pywsgi._INTERNAL_ERROR_HEADERS[:]
            headers[2] = ('Content-Length', str(len(body)))

            self.start_response(pywsgi._INTERNAL_ERROR_STATUS, headers)
            self.write(body)