Unverified Commit 7d0f680a authored by James M Snell's avatar James M Snell
Browse files

fs: use a default callback for fs.close()



The `fs.close()` function requires a callback. Most often the only thing
that callback does is check and rethrow the error if one occurs. To
eliminate common boilerplate, make the callback optional with a default
that checks and rethrows the error as an uncaught exception.

Signed-off-by: default avatarJames M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37174


Reviewed-By: default avatarJuan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: default avatarAntoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarDarshan Sen <raisinten@gmail.com>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: default avatarZijian Liu <lxxyxzj@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
parent bf2f2b74
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment