20
20
import org .openqa .selenium .internal .BuildInfo ;
21
21
22
22
import java .io .BufferedReader ;
23
- import java .io .IOException ;
24
23
import java .io .InputStreamReader ;
25
24
import java .net .InetAddress ;
26
25
import java .net .NetworkInterface ;
27
- import java .net .SocketException ;
28
- import java .net .UnknownHostException ;
29
26
import java .util .Enumeration ;
30
27
import java .util .HashMap ;
31
28
import java .util .Map ;
@@ -67,18 +64,18 @@ public class WebDriverException extends RuntimeException {
67
64
host = reader .readLine ();
68
65
}
69
66
}
70
- } catch (IOException ignored ) {
71
- // Do nothing and fall through
72
67
} catch (InterruptedException e ) {
73
68
Thread .currentThread ().interrupt ();
74
69
throw new RuntimeException (e );
70
+ } catch (Exception e ) {
71
+ // fall through
75
72
}
76
73
}
77
74
if (host == null ) {
78
75
// Give up.
79
76
try {
80
77
host = InetAddress .getLocalHost ().getHostName ();
81
- } catch (UnknownHostException e ) {
78
+ } catch (Exception e ) {
82
79
host = "Unknown" ; // At least we tried.
83
80
}
84
81
}
@@ -96,15 +93,15 @@ public class WebDriverException extends RuntimeException {
96
93
address = inetAddress .getHostAddress ();
97
94
break ;
98
95
}
99
- } catch (SocketException e ) {
96
+ } catch (Exception e ) {
100
97
// Fall through and go the slow way.
101
98
}
102
99
}
103
100
if (address == null ) {
104
101
// Alright. I give up.
105
102
try {
106
103
address = InetAddress .getLocalHost ().getHostAddress ();
107
- } catch (UnknownHostException e ) {
104
+ } catch (Exception e ) {
108
105
address = "Unknown" ;
109
106
}
110
107
}
0 commit comments