Skip to content

src: assign ERR_SCRIPT_EXECUTION_* codes in C++ - #20147

Closed
joyeecheung wants to merge 2 commits into
nodejs:masterfrom
joyeecheung:script-exec-errors
Closed

src: assign ERR_SCRIPT_EXECUTION_* codes in C++#20147
joyeecheung wants to merge 2 commits into
nodejs:masterfrom
joyeecheung:script-exec-errors

Conversation

@joyeecheung

Copy link
Copy Markdown
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-botnodejs-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
Copy Markdown
MemberAuthor

@joyeecheungjoyeecheung 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
@BridgeARBridgeAR 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 teamApril 19, 2018 12:18

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@joyeecheungjoyeecheung 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
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
MemberAuthor

@joyeecheung

Copy link
Copy Markdown
MemberAuthor

__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

joyeecheung commented Apr 23, 2018

Copy link
Copy Markdown
MemberAuthor

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

joyeecheung commented Apr 24, 2018

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Member

Still lgtm

@BridgeARBridgeAR left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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 freeto 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++.errorsIssues and PRs related to JavaScript errors originated in Node.js core.lib / srcIssues and PRs related to general changes in the lib or src directory.replIssues and PRs related to the REPL subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.vmIssues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@joyeecheung@BridgeAR@jasnell@mcollina@TimothyGu@targos@devsnek@nodejs-github-bot