Skip to content
Permalink
Browse files

[JENKINS-48055] - Integrate ChannelClosedException and ChannelStateEx…

…ception.
  • Loading branch information
oleg-nenashev committed Nov 16, 2017
1 parent df3dc72 commit 15154980e3660ed2410b91fdbf7d49f7fb9ec105
@@ -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;
}
@@ -1,5 +1,7 @@
package hudson.remoting;

import org.jenkinsci.remoting.ChannelStateException;

import java.io.IOException;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
@@ -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)}.
@@ -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.
*

0 comments on commit 1515498

Please sign in to comment.
You can’t perform that action at this time.