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

src: try showing stack traces when process._fatalException is not set #29624

Closed
wants to merge 1 commit into from

Conversation

joyeecheung
Copy link
Member

So that the stack trace of errors shown in internal code run during
bootstrap (before process._fatalException is set) can be printed.

Refs: #29593

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

So that the stack trace of errors shown in internal code run during
bootstrap (before process._fatalException is set) can be printed.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 20, 2019
@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member Author

cc @addaleax @cjihrig @Fishrock123

@joyeecheung
Copy link
Member Author

Before the patch if you make a typo in, e.g. bootstrap/node.js, the error is printed as follows:

internal/bootstrap/loaders.js:191
  if (!mod) throw new TypeError(`Missing internal module '${id}'`);
            ^

TypeError: Missing internal module 'internal/process/per_thread1'

After the patch it looks like this:

internal/bootstrap/loaders.js:191
  if (!mod) throw new TypeError(`Missing internal module '${id}'`);
            ^

TypeError: Missing internal module 'internal/process/per_thread1'
    at nativeModuleRequire (internal/bootstrap/loaders.js:191:19)
    at internal/bootstrap/node.js:51:24

@Trott
Copy link
Member

Trott commented Sep 24, 2019

@nodejs/collaborators This one could use some reviews.

@Trott
Copy link
Member

Trott commented Sep 24, 2019

Is it reasonable/feasible to add a test?

Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

Works for me.

I can't think of an easy or particularly necessary way to test this (since it should only occur on internal dev mistakes).

@Fishrock123 Fishrock123 added the lib / src Issues and PRs related to general changes in the lib or src directory. label Sep 24, 2019
@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 24, 2019
@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Sep 25, 2019

Landed in 355f2ad

@Trott Trott closed this Sep 25, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Sep 25, 2019
So that the stack trace of errors shown in internal code run during
bootstrap (before process._fatalException is set) can be printed.

PR-URL: nodejs#29624
Refs: nodejs#29593
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos pushed a commit that referenced this pull request Oct 1, 2019
So that the stack trace of errors shown in internal code run during
bootstrap (before process._fatalException is set) can be printed.

PR-URL: #29624
Refs: #29593
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants