technoweenie/node-chain-gang — Issue #8: finished event arguments in wrong order
Author: matthewleon
Created: 2011-12-29 18:09:20+00:00
State: open

Your readme example contains the following code:

```javascript
chain.on('finished', function(err, name) {
console.log(name, "has finished. Error:", err)
})
```

In reality, the callback will receive its arguments in the reverse order. Here is the relevant code (line 49 of the compiled index.js):

```javascript
this.emit('finished', job.name, err);
```

So either the readme or the code has to change. Personally, I think the code should be changed to reflect the README, even though this might break some applications. Sending the error first is a very strong convention.