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

Use fs.closeSync #22172

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -92012,7 +92012,7 @@ var ts;
};
Logger.prototype.close = function () {
if (this.fd >= 0) {
fs.close(this.fd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just add an empty handler instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because errors will be silently swallowed that way. I can of course do that but I do not feel like that is a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because errors will be silently swallowed that way.

that was the intention anyways.. we are killing the server, we want to try to write to the log if we can, but if we fail, not sure we have much recourse here, the process is dying anyways.

fs.closeSync(this.fd);
}
};
Logger.prototype.getLogFileName = function () {
Expand Down