workaround for security exception

This commit is contained in:
Mariotaku Lee 2016-04-19 16:06:17 +08:00
parent b9b764875a
commit 0e69222fb8
1 changed files with 5 additions and 1 deletions

View File

@ -81,6 +81,8 @@ public class TwidereDns implements Constants, Dns {
} catch (IOException e) {
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
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) {
if (e instanceof UnknownHostException) throw (UnknownHostException) e;
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
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");
// Return if host is an address
final List<InetAddress> fromAddressString = fromAddressString(originalHost, host);