Be paranoid about exceptions in the WebDriverException itself
import org.openqa.selenium.internal.BuildInfo;
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
host = reader.readLine();
}
}
- } catch (IOException ignored) {
- // Do nothing and fall through
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
+ } catch (Exception e) {
+ // fall through
}
}
if (host == null) {
// Give up.
try {
host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
+ } catch (Exception e) {
host = "Unknown"; // At least we tried.
}
}
address = inetAddress.getHostAddress();
break;
}
- } catch (SocketException e) {
+ } catch (Exception e) {
// Fall through and go the slow way.
}
}
// Alright. I give up.
try {
address = InetAddress.getLocalHost().getHostAddress();
- } catch (UnknownHostException e) {
+ } catch (Exception e) {
address = "Unknown";
}
}
