3rd-Eden/node-memcached — pull request #74 by sebastianseilund (2012-12-01 00:34:12+00:00)
Title: Changed all errors to be instances of Error instead of plain strings (second try)

Hi

I updated to latest master in this pull request. I have closed #73.

This makes debugging a lot easier, and adds to the module's robustness.

The error for "Item is not stored" has a special use case, as it's something you expect could happen. The error object for this error message has a notStore=true property. It's useful like this:

```javascript
memcached.add('only-set-me-once', Date.now(), 0, function(err) {
if (err && !err.notStored)) {
//Only throw the error, if it wasn't the notStored "error", which we expect to happen sometimes.
throw err;
}
//Callback or whatever you wanna do
});
```

Unit tests pass after the changes.

Sebastian