workaround for security exception
This commit is contained in:
parent
b9b764875a
commit
0e69222fb8
|
@ -81,6 +81,8 @@ public class TwidereDns implements Constants, Dns {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
|
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
|
||||||
throw new UnknownHostException("Unable to resolve address " + e.getMessage());
|
throw new UnknownHostException("Unable to resolve address " + e.getMessage());
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
throw new UnknownHostException("Security exception" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +92,8 @@ public class TwidereDns implements Constants, Dns {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
|
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
|
||||||
throw new UnknownHostException("Unable to resolve address " + e.getMessage());
|
throw new UnknownHostException("Unable to resolve address " + e.getMessage());
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
throw new UnknownHostException("Security exception" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +104,7 @@ public class TwidereDns implements Constants, Dns {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
|
private List<InetAddress> resolveInternal(final String originalHost, final String host, final int depth,
|
||||||
final boolean useResolver) throws IOException {
|
final boolean useResolver) throws IOException, SecurityException {
|
||||||
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
|
final TimingLogger logger = new TimingLogger(RESOLVER_LOGTAG, "resolve");
|
||||||
// Return if host is an address
|
// Return if host is an address
|
||||||
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
|
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);
|
||||||
|
|
Loading…
Reference in New Issue