You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There was no error message or exception when set() being called with the below illegal argument:
1.Path did not start with / character
2.Path end with / character,
instead, it just causes the process to stop here and nothing happens, and znode did not being set. Describe the solution you'd like
An exception being thrown that displays the illegal argument, just as zookeeper client, such as...
const set(path, data, version) {
...
if (typeof zNodePath === 'string' && zNodePath.endsWith('/')) {
throw new Error(Set Znode fail, ZNode: ${zNodePath} must not end with / character);
}
.... (and the same checking for !startWith('/')
Describe alternatives you've considered
add "Path must start with / character" and "Path must not end with / character" to the response of set() Additional context
it's the same behavior as zkCli.sh:
[zk: localhost:2181(CONNECTED) 2] create notStartWithSlash ""
Command failed: java.lang.IllegalArgumentException: Path must start with / character
[zk: localhost:2181(CONNECTED) 3] create /endWithSlash/ ""
Command failed: java.lang.IllegalArgumentException: Path must not end with / character
[zk: localhost:2181(CONNECTED) 4]
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
There was no error message or exception when set() being called with the below illegal argument:
1.Path did not start with / character
2.Path end with / character,
instead, it just causes the process to stop here and nothing happens, and znode did not being set.
Describe the solution you'd like
An exception being thrown that displays the illegal argument, just as zookeeper client, such as...
const set(path, data, version) {
...
if (typeof zNodePath === 'string' && zNodePath.endsWith('/')) {
throw new Error(
Set Znode fail, ZNode: ${zNodePath} must not end with / character
);}
.... (and the same checking for !startWith('/')
Describe alternatives you've considered
add "Path must start with / character" and "Path must not end with / character" to the response of set()
Additional context
it's the same behavior as zkCli.sh:
[zk: localhost:2181(CONNECTED) 2] create notStartWithSlash ""
Command failed: java.lang.IllegalArgumentException: Path must start with / character
[zk: localhost:2181(CONNECTED) 3] create /endWithSlash/ ""
Command failed: java.lang.IllegalArgumentException: Path must not end with / character
[zk: localhost:2181(CONNECTED) 4]
The text was updated successfully, but these errors were encountered: