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: assign ERR_SCRIPT_EXECUTION_* codes in C++ #20147

Closed
wants to merge 2 commits into from

Conversation

joyeecheung
Copy link
Member

src: assign ERR_SCRIPT_EXECUTION_* codes in C++

Also modifies the error messages so they include more information
and are more consistent.

  • The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
    SIGINT and the trailing period is dropped for consistency.
  • Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
    in the message.

The first commit is taken from #20146

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

@nodejs-github-bot nodejs-github-bot added 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. labels Apr 19, 2018
@joyeecheung
Copy link
Member Author

@joyeecheung joyeecheung added semver-major PRs that contain breaking changes and should be released in the next major version. vm Issues and PRs related to the vm subsystem. repl Issues and PRs related to the REPL subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Apr 19, 2018
@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 19, 2018
@BridgeAR BridgeAR requested a review from a team April 19, 2018 12:18
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@joyeecheung joyeecheung removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 22, 2018
@joyeecheung
Copy link
Member Author

Some OS could not recognize PRId64 from inttypes.h, trying cinttypes.

CI: https://ci.nodejs.org/job/node-test-pull-request/14425/

@BridgeAR
Copy link
Member

There is a failure on AIX:

In file included from ../src/module_wrap.cc:7:0:
../src/node_errors.h: In function 'void node::THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(node::Environment*, int64_t)':
../src/node_errors.h:75:44: error: expected ')' before 'PRId64'
       "Script execution timed out after %" PRId64 "ms", timeout);
                                            ^~~~~~

@joyeecheung
Copy link
Member Author

@joyeecheung
Copy link
Member Author

__STDC_FORMAT_MACROS still does not work on AIX...trying _ALL_SOURCE

CI: https://ci.nodejs.org/job/node-test-pull-request/14435/

Also modifies the error messages so they include more information
and are more consistent.

- The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
  SIGINT and the trailing period is dropped for consistency.
- Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
  in the message.
@joyeecheung
Copy link
Member Author

joyeecheung commented Apr 23, 2018

Still cannot get the format specifiers on AIX. Might as well just use string streams instead of working around those macros since we may need more in node_errors.h in the future.

CI: https://ci.nodejs.org/job/node-test-pull-request/14446/
CI: https://ci.nodejs.org/job/node-test-pull-request/14475/

@joyeecheung
Copy link
Member Author

joyeecheung commented Apr 24, 2018

The last CI looks clean (only a known issue on osx1010 that should be fixed by #20195). If there are no objections against using stringstream instead of snprintf to work around the lack of PRId64 on AIX, I am going to land this tomorrow.

cc @mcollina @jasnell @TimothyGu @targos @devsnek @BridgeAR

@jasnell
Copy link
Member

jasnell commented Apr 24, 2018

Still lgtm

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Still LGTM

@joyeecheung
Copy link
Member Author

Landed in 3152b7c, thanks!

joyeecheung added a commit that referenced this pull request Apr 25, 2018
Also modifies the error messages so they include more information
and are more consistent.

- The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
  SIGINT and the trailing period is dropped for consistency.
- Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
  in the message.

PR-URL: #20147
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core. lib / src Issues and PRs related to general changes in the lib or src directory. repl Issues and PRs related to the REPL subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants