Skip to content

doc net: incorrect error handling documented for listen() #5345

Description

@trevnorris

Under the section https://nodejs.org/api/net.html#net_server_address it states that the error is passed to the listen() callback. This is incorrect. The error is passed to the server's 'error' event handler. Like so:

net.createServer()
  .on('error', () => console.log('foo'))
  .listen(80, () => console.log('bar'));
// Output: foo

Filing this instead of simply fixing this one occurrence b/c unsure if more cases like this exist, and don't have the time to investigate at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions