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

server.close() callback error argument is undefined #47261

Open
armanbilge opened this issue Mar 26, 2023 · 1 comment
Open

server.close() callback error argument is undefined #47261

armanbilge opened this issue Mar 26, 2023 · 1 comment

Comments

@armanbilge
Copy link

Version

v19.8.1

Platform

Linux armanbilge-sandbox-d5bpibghud0 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

const net = require("net")
const server = net.createServer()
server.listen()
server.close(x => console.log(typeof(x)))

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

Following discussion in #44290 (comment) and #47229 (comment), to be consistent with other Node.js APIs null should be used to indicate there is no error.

What do you see instead?

$ npx node@19 test.js 
undefined

Additional information

No response

@mk-pmb
Copy link

mk-pmb commented Mar 26, 2023

I don't see a bug here. Robustness principle at work. (More details in #47229 )

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