[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022319#comment-16022319
 ] 

ASF GitHub Bot commented on ZOOKEEPER-2757:
-------------------------------------------

Github user hanm commented on the issue:

    https://github.com/apache/zookeeper/pull/240
  
    Agree with what you said, Abe, in a generic context : ) - for CLI use cases 
though I am wondering why we should crash even in cases as you mentioned "So if 
it does pop up for reasons other than a bad path" - in such case should we 
always print the error message and not crashing the CLI? Would that be more 
helpful for user experience comparing to crash and leave no ideas to users what 
went wrong? Basically my point is that I don't any use case where the CLI's 
state is so bad that it can't recover from an unchecked exception so it has to 
be killed. 
    
    Other than this patch looks good to me. One nit - a new compiler waring is 
introduced.


> Incorrect path crashes zkCli
> ----------------------------
>
>                 Key: ZOOKEEPER-2757
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2757
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.3
>            Reporter: Flavio Junqueira
>            Assignee: Abraham Fine
>            Priority: Minor
>             Fix For: 3.5.4
>
>
> If I try {{delete test}} without the leading /, then the CLI crashes with 
> this exception:
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: Path must 
> start with / character
>       at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:51)
>       at org.apache.zookeeper.ZooKeeper.delete(ZooKeeper.java:1659)
>       at org.apache.zookeeper.cli.DeleteCommand.exec(DeleteCommand.java:83)
>       at 
> org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:655)
>       at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:586)
>       at 
> org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:370)
>       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:330)
>       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:292)
> {noformat}
> It should really fail the operation rather than crash the CLI.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to