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

tools: better error message for failed tools/doc/generate #25064

Closed

Conversation

addaleax
Copy link
Member

When one creates a bogus node executable during development,
sometimes an issue that comes up is a failing invocation
of tools/doc/generate.js --apilinks=..., which continues
to fail afterwards. Removing the target file helps, but
there was no indication of that in the error message;
therefore, print a better one and suggest removing the file in it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

When one creates a bogus `node` executable during development,
sometimes an issue that comes up is a failing invocation
of `tools/doc/generate.js --apilinks=...`, which continues
to fail afterwards. Removing the target file helps, but
there was no indication of that in the error message;
therefore, print a better one and suggest removing the file in it.
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Dec 15, 2018
fs.readFileSync(filename, 'utf8')
);
} catch (e) {
console.log(`Failure reading ${filename}, maybe remove it?`);
Copy link
Member

@joyeecheung joyeecheung Dec 16, 2018

Choose a reason for hiding this comment

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

I don't think removing it always solve the issue, depending on how the file is generated the next time (which in turn depends on Makefile deps handling). Usually when I run into this it's because the file is empty (JSON.parse('') errors) because the content is piped from stdout instead of being written by the bogus binary (in which case it would fail properly instead of piping out an empty file silently).

Alternative solution: #25019

@addaleax
Copy link
Member Author

@joyeecheung Sorry, missed your PR – thanks for pointing this out!

@addaleax addaleax closed this Dec 16, 2018
@addaleax addaleax deleted the tools-doc-generate-apilinks-fail branch December 16, 2018 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants