tisonkun commented on code in PR #520: URL: https://github.com/apache/curator/pull/520#discussion_r1914810547
########## curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java: ########## @@ -462,11 +463,16 @@ public String getNamespace() { private void checkState() { CuratorFrameworkState state = getState(); - Preconditions.checkState( - state == CuratorFrameworkState.STARTED, - "Expected state [%s] was [%s]", - CuratorFrameworkState.STARTED, - state); + switch (state) { + case STARTED: + return; + case STOPPED: + throw new CuratorClosedException(); + default: + String msg = String.format( + "Expected state [%s] was [%s]", CuratorFrameworkState.STARTED, CuratorFrameworkState.STOPPED); Review Comment: ```suggestion "Expected state [%s] was [%s]", CuratorFrameworkState.STARTED, state); ``` ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@curator.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org