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

AssertionError: non-error thrown: false #3

Closed
fengmk2 opened this issue May 4, 2014 · 11 comments
Closed

AssertionError: non-error thrown: false #3

fengmk2 opened this issue May 4, 2014 · 11 comments
Assignees
Labels

Comments

@fengmk2
Copy link
Member

fengmk2 commented May 4, 2014

assert.js:98
  throw new assert.AssertionError({
        ^
AssertionError: non-error thrown: false
    at Object.app.context.onerror (/Users/mk2/git/personalweb/node_modules/chair/node_modules/koa-onerror/index.js:50:5)
    at Socket.done (/Users/mk2/git/personalweb/node_modules/chair/node_modules/koa/node_modules/finished/index.js:15:5)
    at Socket.EventEmitter.emit (events.js:126:20)
    at TCP.close (net.js:467:12)
@fengmk2 fengmk2 added the bug label May 4, 2014
@fengmk2
Copy link
Member Author

fengmk2 commented May 4, 2014

finished module:

module.exports = function (thingie, callback) {
  var socket = thingie.socket || thingie
  var res = thingie.res || thingie
  if (!socket.writable)
    return setImmediate(callback)

  socket.on('error', done)
  socket.on('close', done)
  res.on('finish', done)

  function done(err) {
    socket.removeListener('error', done)
    socket.removeListener('close', done)
    res.removeListener('finish', done)
    callback(err)
  }

  return thingie
}

@fengmk2
Copy link
Member Author

fengmk2 commented May 4, 2014

https://github.com/joyent/node/blob/master/lib/net.js#L461

var isException = exception ? true : false;
    this._handle.close(function() {
      debug('emit close');
      self.emit('close', isException);
    });

@dead-horse
Copy link
Member

err in callback(err) is false, not instance of Error?

@fengmk2
Copy link
Member Author

fengmk2 commented May 4, 2014

when socket close event emit, err is a Boolean

@dead-horse
Copy link
Member

hmmm. ping @jonathanong

@dead-horse
Copy link
Member

i think it should fixed in finished

@fengmk2
Copy link
Member Author

fengmk2 commented May 4, 2014

thingie.socket is ctx.socket, but why we need to listen error and close event?

@jonathanong
Copy link
Member

Already fixed this in latest finished

@fengmk2
Copy link
Member Author

fengmk2 commented May 5, 2014

same as jshttp/on-finished#1

close by jshttp/on-finished@8b2baaa

@fengmk2 fengmk2 closed this as completed May 5, 2014
@fengmk2
Copy link
Member Author

fengmk2 commented May 5, 2014

@jonathanong Also need to update koa deps: finished: '~1.1.3'

@jonathanong
Copy link
Member

is that really necessary? semver can do the work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants