Skip to content

Commit d8a6159

Browse files
committed
Merge pull request #411 from ajkannan/fix-socket-api-bug
Avoid throwing exception when checking isLocalHost in Datastore
2 parents a27282e + fc2ab10 commit d8a6159

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
import org.json.JSONTokener;
4343

4444
import java.net.InetAddress;
45-
import java.net.MalformedURLException;
4645
import java.net.URL;
47-
import java.net.UnknownHostException;
4846
import java.util.HashMap;
4947
import java.util.Map;
5048

@@ -95,7 +93,7 @@ private static boolean isLocalHost(String host) {
9593
}
9694
InetAddress hostAddr = InetAddress.getByName(new URL(normalizedHost).getHost());
9795
return hostAddr.isAnyLocalAddress() || hostAddr.isLoopbackAddress();
98-
} catch (UnknownHostException | MalformedURLException e) {
96+
} catch (Exception e) {
9997
// ignore
10098
}
10199
}

0 commit comments

Comments
 (0)