taskrabbit/node-resque — pull request #36 by fiznool (2014-05-22 15:12:23+00:00)
Title: Updated queue, scheduler and worker to pass back error on connection fai...

At the moment, if you do:

``` js
var connectionDetails = {
host: "127.0.0.1",
password: "",
port: "wrongport",
database: 0,
}
var queue = new NR.queue(
{ connection: connectionDetails },
jobs,
function(err) {
if(err) { throw err; } // Never thrown because err is always undefined
console.log('Task Queue started OK');
}
);
```

The error handling won't kick in because the connection error is never passed through.

This PR fixes this, and hopefully also for the worker and scheduler.

**Note:** I couldn't get the scheduler tests to work correctly with the extra test I added, so I had to `xit` it out. Please could you take a look and see what is going wrong (try un-xitting and see what I mean).

Oh, and I added a few missing semicolons just for good measure :-)