//Do not leave this in production code
//logger.finest("connect: scheme=" + scheme + ", uri=" + uri + ", factory-impl=" + factory.getClass().getName());
return factory.getConnection(uri);
} catch (Throwable e) {
Client.fireEvent(new ConnectionFailed(uri, e));
if (e instanceof IOException) {
throw (IOException) e;
} else {
throw new IOException(e);