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

Error with GET key #1

Open
jerrojelly opened this issue Mar 6, 2017 · 1 comment
Open

Error with GET key #1

jerrojelly opened this issue Mar 6, 2017 · 1 comment

Comments

@jerrojelly
Copy link

jerrojelly commented Mar 6, 2017

What does it mean to add CRLF? append \n\r still crash RedCat

try cat.updateValue(["Joannis", "Orlandos", 20], forKey: "qwe:123")
print("\(try cat.listKeys("qwe*"))")
print("\(try cat.get("qwe*"))")  <--- Error CRLF
print("\(try cat.get("qwe:123"))")  <--- No error, return the array result

fatal error: Error raised at top level: DRIVER String length not terminated with CRLF: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-800.0.63/src/swift/stdlib/public/core/ErrorType.swift, line 184

@jerrojelly
Copy link
Author

jerrojelly commented Mar 6, 2017

The output for nonexistent key with GET in redis-cli is (nil) Null Bulk String, it is a valid scenario to display as empty or "notfound" instead of error?

127.0.0.1:6379> GET qwe*
(nil)

This is called a Null Bulk String. The client library API should not return an empty string, but a nil object, when the server replies with a Null Bulk String. For example a Ruby library should return 'nil' while a C library should return NULL (or set a special flag in the reply object), and so forth.
https://redis.io/topics/protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant