Skip to content

Commit

Permalink
[JENKINS-48055] - Integrate ChannelClosedException and ChannelStateEx…
Browse files Browse the repository at this point in the history
…ception.
  • Loading branch information
oleg-nenashev committed Nov 16, 2017
1 parent df3dc72 commit 1515498
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/remoting/Callable.java
Expand Up @@ -85,7 +85,7 @@ default Channel getChannelOrFail() throws ChannelStateException {
default Channel getOpenChannelOrFail() throws ChannelStateException {
final Channel ch = getChannelOrFail();
if (ch.isClosingOrClosed()) {
throw new ChannelStateException("The associated channel " + ch + " is closing down or has closed down", ch.getCloseRequestCause());
throw new ChannelClosedException("The associated channel " + ch + " is closing down or has closed down", ch.getCloseRequestCause());
}
return ch;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/remoting/ChannelClosedException.java
@@ -1,5 +1,7 @@
package hudson.remoting;

import org.jenkinsci.remoting.ChannelStateException;

import java.io.IOException;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
Expand All @@ -9,7 +11,7 @@
*
* @author Kohsuke Kawaguchi
*/
public class ChannelClosedException extends IOException {
public class ChannelClosedException extends ChannelStateException {
/**
* @deprecated
* Use {@link #ChannelClosedException(Throwable)} or {@link #ChannelClosedException(java.lang.String, java.lang.Throwable)}.
Expand Down
Expand Up @@ -28,7 +28,6 @@

import java.io.IOException;

//TODO: ClosedChannelException probably needs to be reworked in order to implement this type as well.
/**
* Indicates invalid state of the channel during the operation.
*
Expand Down

0 comments on commit 1515498

Please sign in to comment.