package org.yamcs.api.ws;
import java.net.URI;
import java.net.URISyntaxException;

public class YamcsConnectionProperties {
    private String host;
    private int port;
    private String instance;
    
    public YamcsConnectionProperties(String host, int port, String instance) {
        this.host = host;
        this.port = port;
        this.instance = instance;
    }

    public URI webResourceURI(String relativePath) {
        if (!relativePath.startsWith("/")) {
            relativePath = "/" + relativePath;
        }
        try {
            return new URI("http://" + host + ":" + port + "/" + instance + relativePath);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }

    public URI webSocketURI() {
        try {
            return new URI("ws://" + host + ":" + port + "/" + instance + "/_websocket");
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }
}
@@ -19,16 +19,17 @@
 api.ws;%0A
+%0A
 import j
@@ -78,16 +78,58 @@
 ption;%0A%0A
+import org.yamcs.ConfigurationException;%0A%0A
 public c
@@ -737,33 +737,54 @@
 row new 
-RuntimeException(
+ConfigurationException(%22Invalid URL%22, 
 e);%0A    
@@ -999,25 +999,46 @@
 new 
-RuntimeException(
+ConfigurationException(%22Invalid URL%22, 
 e);%0A

Throw ConfigurationException on urlparse exception