1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00

Docs and example of listening for "error" event.

This commit is contained in:
Matt Ranney
2010-09-23 14:41:34 -07:00
parent a774d9aef5
commit a6bfae83b9
2 changed files with 23 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
var redis = require("redis"),
client = redis.createClient();
client.on("error", function (err) {
console.log("Redis connection error to " + client.host + ":" + client.port + " - " + err);
});
client.set("string key", "string val", redis.print);
client.hset("hash key", "hashtest 1", "some value", redis.print);
client.hset(["hash key", "hashtest 2", "some other value"], redis.print);