mranney/node_redis — pull request #538 by skeggse (2014-01-09 20:40:41+00:00)
Title: Add code property to redis errors

The [redis protocol](http://redis.io/topics/protocol) implies all error responses will begin with an all-caps specific error code, which could be included in the `code` property of the parsed error object.

```js
function require_error(label, code) {
return function (err, results) {
assert.notEqual(err, null, label + " err is null, but an error is expected here.");
assert.strictEqual(err.code, code, label + " expected err with code " + code + ", got code: " + err.code);
return true;
};
}

client.evalsha("ffffffffffffffffffffffffffffffffffffffff", 0, require_error("EVALSHA", "NOSCRIPT"));
```