Skip to content

Commit

Permalink
iss-4535
Browse files Browse the repository at this point in the history
Altered some catch statements to catch exceptions rather than throwables for sonar

fabric8io#4535
  • Loading branch information
BrianDevC committed Nov 1, 2022
1 parent a0fac41 commit fa69db3
Showing 1 changed file with 10 additions and 10 deletions.
Expand Up @@ -185,26 +185,26 @@ public Loggable withLogWaitTimeout(Integer logWaitTimeout) {
public PortForward portForward(int port, ReadableByteChannel in, WritableByteChannel out) {
try {
return new PortForwarderWebsocket(httpClient, this.context.getExecutor()).forward(getResourceUrl(), port, in, out);
} catch (Throwable t) {
throw KubernetesClientException.launderThrowable(t);
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(e);
}
}

@Override
public LocalPortForward portForward(int port) {
try {
return new PortForwarderWebsocket(httpClient, this.context.getExecutor()).forward(getResourceUrl(), port);
} catch (Throwable t) {
throw KubernetesClientException.launderThrowable(t);
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(e);
}
}

@Override
public LocalPortForward portForward(int port, int localPort) {
try {
return new PortForwarderWebsocket(httpClient, this.context.getExecutor()).forward(getResourceUrl(), port, localPort);
} catch (Throwable t) {
throw KubernetesClientException.launderThrowable(t);
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(e);
}
}

Expand Down Expand Up @@ -274,8 +274,8 @@ public ExecWatch exec(String... command) {
try {
URL url = getExecURLWithCommandParams(actualCommands);
return setupConnectionToPod(url.toURI());
} catch (Throwable t) {
throw KubernetesClientException.launderThrowable(forOperationType("exec"), t);
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(forOperationType("exec"), e);
}
}

Expand All @@ -284,8 +284,8 @@ public ExecWatch attach() {
try {
URL url = getAttachURL();
return setupConnectionToPod(url.toURI());
} catch (Throwable t) {
throw KubernetesClientException.launderThrowable(forOperationType("attach"), t);
} catch (Exception e) {
throw KubernetesClientException.launderThrowable(forOperationType("attach"), e);
}
}

Expand Down

0 comments on commit fa69db3

Please sign in to comment.