class RestException extends RuntimeException {

    private static final long serialVersionUID = 1783560981699960801L;

    private final Rest.Protocol protocol;
    private final Rest.Method method;
    private final String host;
    private final int port;
    private final String username;
    private final String path;

    public RestException(Throwable cause, Rest.Protocol protocol,
                         Rest.Method method, String username, String host,
                         int port, String path, Option[] options) {
        super(message(protocol, method, username, host, port, path, options), cause);
        this.protocol = requireNonNull(protocol);
        this.method   = requireNonNull(method);
        this.host     = requireNonNull(host);
        this.port     = port;
        this.username = username;
        this.path     = path;
    }

    @Override
    public String toString() {
        return "RestException{" +
            "protocol=" + protocol +
            ", method=" + method +
            ", host='" + host + '\'' +
            ", port=" + port +
            ", username='" + username + '\'' +
            ", path='" + path + '\'' +
            '}';
    }

    private static String message(Rest.Protocol protocol, Rest.Method method,
                                  String username, String host, int port,
                                  String path, Option[] options) {<FILL_FUNCTION_BODY>}
}


        final StringBuilder str = new StringBuilder("Exception while invoking ");
        str.append(method).append(' ');
        if (username != null) str.append(username).append('@');
        str.append(protocol.name().toLowerCase()).append("://");
        str.append(host);
        if (port > 0) str.append(':').append(port);
        if (!path.isEmpty() && !path.equals("/")) {
            if (!path.startsWith("/")) str.append('/');
            str.append(path);
        }

        final Param[] params = Stream.of(options)
            .filter(Objects::nonNull)
            .filter(o -> o.getType() == PARAM)
            .filter(Param.class::isInstance)
            .map(Param.class::cast)
            .toArray(Param[]::new);

        if (params.length > 0) {
            str.append(
                Arrays.stream(params)
                    .map(Param::toString)
                    .collect(joining("&", "?", ""))
            );
        }

        return str.toString();
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.Throwable) ,public void <init>(java.lang.String, java.lang.Throwable) <variables>static final long serialVersionUID