Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finished event arguments in wrong order #8

Closed
matthewleon opened this issue Dec 29, 2011 · 1 comment
Closed

finished event arguments in wrong order #8

matthewleon opened this issue Dec 29, 2011 · 1 comment

Comments

@matthewleon
Copy link

Your readme example contains the following code:

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):

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.

@technoweenie
Copy link
Owner

Ah, I did that because I didn't want to break compatibility. Let's make this crap correct for 1.0.

technoweenie added a commit that referenced this issue Dec 29, 2011
…node libs

As pointed out in #8, the read me and the code didn't agree with the
position
of the "finished" callback arguments.  I hate to make such a weird
breaking
change, but the library should act like other node libs as it hits 1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants