Closed
Description
Hi, I like the C++ style, the features of the project. However I could not make the simplest code work on my machine (centos 7).
The call set() throw an exception:
A null status reply
Could you please help?
Thanks
---Patrick
int main()
{
try {
// Create an Redis object, which is movable but NOT copyable.
auto redis = Redis("tcp://127.0.0.1:6379");
// ***** STRING commands *****
redis.set("key", "val"); //exception is thrown here
std::cout << "Redis set key\n";
auto val = redis.get("key"); // val is of type OptionalString. See 'API Reference' section for details.
if (val) {
// Dereference val to get the returned value of std::string type.
std::cout << *val << std::endl;
} // else key doesn't exist.
else
{
std::cerr << "Key key does not exist\n";
}
} catch (const Error &e) {
// Error handling.
std::cerr << e.what() << "\n";
}
}
Metadata
Metadata
Assignees
Labels
No labels