Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KV should raise an error if the key contains unacceptable characters #553

Open
kevinhikaruevans opened this issue Apr 8, 2024 · 0 comments
Labels
proposal Enhancement idea or proposal

Comments

@kevinhikaruevans
Copy link

Proposed change

If the key contains unacceptable characters (e.g. whitespace), an error should be raised. Maybe BadSubjectError can be reused or a new error can be created (e.g. BadKeyError).

It currently gives an UnexpectedEOF error and causes a TimeoutError. This is fairly confusing because it doesn't necessarily imply the key is bad and could be remedied by a quick check on the key.

Use case

I had somebody else feeding me some data, which was being fed into nats kv. I noticed that occasionally, an entry would cause an eof error and a timeout error and it wasn't very clear why. I finally realized that the user was putting spaces in the keys, which was causing problems in the underlying publish() call.

Contribution

Sure. I would assume it would be putting in a little check in put()

@kevinhikaruevans kevinhikaruevans added the proposal Enhancement idea or proposal label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

1 participant