The exception class has to be "fixed" You may register a serviceId with invalid URI characters (e.g.: '_'), but the URI::getHost() fails when such chars are found.