Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up"error" event handlers require the error to be handled twice #1274
Comments
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Jul 13, 2019
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Jul 13, 2019
stale
bot
closed this
Jul 20, 2019
This comment has been minimized.
This comment has been minimized.
|
If you name the variable this.port.on('error', err => {
node.warn('an error occurred ' + err.message)
})If you don't want to use the error, then don't include an this.port.on('error', () => {
node.warn('an error occurred')
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Holger-Will commentedApr 14, 2019
What version of standard?
12.0.1
What operating system, Node.js, and npm version?
linux, node 8.4.0 (my min version), npm 6.9.0
What did you expect to happen?
when using an event bases error handler:
i get
Expected error to be handledbut when i use
everything is fine.
this seems superfluous to me. The error handler is only called if there is an error, so
erris always an error object.I think you should not be required to check for the error object in this case.