[api] Implement next(err) and modify errorHandling #26

Merged
merged 1 commit into from Mar 27, 2012

Conversation

Projects
None yet
3 participants
Contributor

pksunkara commented Mar 27, 2012

This is compatible with connect.

Contributor

pksunkara commented Mar 27, 2012

@indexzero @jesusabdullah Could you please look into this urgently?

We have to release a new union version which is connect compatible.

Contributor

jfhbrook commented Mar 27, 2012

lgtm but I would like @indexzero to give a quick look at the proposed api changes before this gets pulled in.

Owner

indexzero commented Mar 27, 2012

@pksunkara lgtm. Please merge this and #15 and publish as union@0.2.2

Owner

indexzero commented Mar 27, 2012

Actually scratch that. Given the breaking nature of this change publish it as union@0.3.0

Contributor

pksunkara commented Mar 27, 2012

API changes

onError is changed from

function (err) {}

to

function (err, req, res) {}

Core errorHandler

This is changed so that it is in accordance with onError

Connect compatibility

Implement next(err) which calls onError || core.errorHandler

function (err) {
  if (err) {
    // call onError
  } else {
    res.emit('next')
  }
}

@pksunkara pksunkara added a commit that referenced this pull request Mar 27, 2012

@pksunkara pksunkara Merge pull request #26 from flatiron/connect-compatible-error-handling
[api] Implement next(err) and modify errorHandling
dda33b1

@pksunkara pksunkara merged commit dda33b1 into master Mar 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment