def METHOD_NAME(req, fd=sys.stderr):
    """get some debugging information about the current exception for sending
    out when we raise an exception
    """
    fd.write("Request object information:\n")
    fd.write(f"URI: {req.unparsed_uri}\n")
    fd.write(
        "Remote Host: {remote_host}\nServer Name: {server_hostname}:{server_port}\n".format(
            remote_host=req.get_remote_host(),
            server_hostname=req.server.server_hostname,
            server_port=req.server.port,
        )
    )
    fd.write("Headers passed in:\n")
    for key, value in sorted(req.headers_in.items()):
        fd.write(f"\t{key}: {value}\n")
    return 0