Skip to content

Commit

Permalink
[JENKINS-48761] - Use pre-Remoting 3.0 ChannelClosedException APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Jan 2, 2018
1 parent 4eb314b commit cf15897
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -30,7 +30,7 @@ public void checkRoles(RoleChecker checker) throws SecurityException {
protected static Channel _getChannelOrFail() throws ChannelClosedException {
final Channel ch = Channel.current();
if (ch == null) {
throw new ChannelClosedException("No channel associated with the thread", null);
throw new ChannelClosedException(new IllegalStateException("No channel associated with the thread"));
}
return ch;
}
Expand All @@ -40,7 +40,7 @@ protected static Channel _getChannelOrFail() throws ChannelClosedException {
protected static Channel _getOpenChannelOrFail() throws ChannelClosedException {
final Channel ch = _getChannelOrFail();
if (ch.isClosingOrClosed()) { // TODO: Since Remoting 2.33, we still need to explicitly declare minimal Remoting version
throw new ChannelClosedException("The associated channel " + ch + " is closing down or has closed down", ch.getCloseRequestCause());
throw new ChannelClosedException(new IllegalStateException("The associated channel " + ch + " is closing down or has closed down", ch.getCloseRequestCause()));
}
return ch;
}
Expand Down

0 comments on commit cf15897

Please sign in to comment.