Skip to content

Loading…

No error returned when trying to add a key which already exists #60

Closed
privman opened this Issue · 4 comments

2 participants

@privman

Not sure if this is by design, but it surprised me.
If I add the same key twice, memcached server returns a "NOT_STORED" reply for the second attempt, which is listed as an error response under privates.parsers (but the parser returns a CONTINUE value), and node-memcached does not return an error.
I imagine the same behaviour applies to other error parsers which return a CONTINUE value.
Test case for this issue: privman@9e597f8 (hasn't been run because I haven't been able to run mocha on my Windows machine)

@3rd-Eden
Owner

@privman The CONTINUE tells the parser to just continue parsing information, but it should actually store an error somewhere.

@3rd-Eden
Owner

Btw, if you could make a pull request for the test it would be great.

@privman
@3rd-Eden 3rd-Eden closed this in d4e7fde
@3rd-Eden
Owner

Thanks for reporting the issue, I resolved it as seen in the commit issued above.
I decided to not return an error when a key is not found, as that would just give a false value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.