Skip to content

Commit 5f557d0

Browse files
committed
add exception catcher while parsing port or IP + bump version number
1 parent 1f2ad82 commit 5f557d0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>de.craftmania</groupId>
88
<artifactId>DockerizedCraft</artifactId>
9-
<version>0.2.5</version>
9+
<version>0.2.6</version>
1010

1111
<distributionManagement>
1212
<repository>

src/main/java/de/craftmania/dockerizedcraft/container/inspector/kubernetes/PodWatcher.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,16 @@ public void eventReceived(Action action, Pod resource) {
9494
logger.info("[Kubernetes Container Inspector] port: " + port);
9595
logger.info("[Kubernetes Container Inspector] ip: " + ip);
9696
}
97-
containerEvent.setPort(Integer.parseInt(port));
98-
containerEvent.setIp(InetAddress.getByName(ip));
97+
try {
98+
containerEvent.setPort(Integer.parseInt(port));
99+
containerEvent.setIp(InetAddress.getByName(ip));
100+
}
101+
catch(Exception ex) {
102+
if (this.debug) {
103+
logger.info("Error while parsing port or IP.");
104+
}
105+
return;
106+
}
99107
} else {
100108
if (this.debug) {
101109
logger.info("[Kubernetes Container Inspector] env:" + environmentVariables);

0 commit comments

Comments
 (0)