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,lib: introduce util.getSystemErrorMessage(err) #54075

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

juanarbol
Copy link
Member

This patch adds a new utility function which provides human-readable string description of the given system error code.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Jul 28, 2024
@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2024
@nodejs-github-bot
Copy link
Collaborator

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

Copy link

codecov bot commented Jul 28, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (8ed50bc) to head (f42721b).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/uv.cc 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54075      +/-   ##
==========================================
- Coverage   88.41%   88.40%   -0.01%     
==========================================
  Files         653      653              
  Lines      187485   187513      +28     
  Branches    36095    36100       +5     
==========================================
+ Hits       165764   165774      +10     
- Misses      14966    14977      +11     
- Partials     6755     6762       +7     
Files with missing lines Coverage Δ
lib/internal/util.js 96.96% <100.00%> (-0.10%) ⬇️
lib/util.js 97.29% <100.00%> (+0.09%) ⬆️
src/uv.cc 90.62% <90.00%> (+1.53%) ⬆️

... and 21 files with indirect coverage changes

int err;
if (!args[0]->Int32Value(env->context()).To(&err)) return;
CHECK_LT(err, 0);
char message[50];
Copy link
Member

Choose a reason for hiding this comment

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

Why 50? Can you add a comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment?

src/uv.cc Outdated Show resolved Hide resolved
* @returns {string}
*/
function getSystemErrorMessage(err) {
validateNumber(err, 'err');
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to call validateNumber since in the next line we check for SafeNumber?

Copy link
Member Author

Choose a reason for hiding this comment

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

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 30, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 30, 2024
@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 31, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 31, 2024
@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 1, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 2, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 2, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 8, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 8, 2024
@nodejs-github-bot
Copy link
Collaborator

doc/api/util.md Outdated Show resolved Hide resolved
@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 19, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 19, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 20, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 20, 2024
@nodejs-github-bot
Copy link
Collaborator

This patch adds a new utility function which provides human-readable
string description of the given system error code.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@juanarbol
Copy link
Member Author

Ping to @nodejs/libuv

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 19, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 19, 2024
@nodejs-github-bot nodejs-github-bot merged commit 61e52c8 into nodejs:main Oct 19, 2024
55 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 61e52c8

aduh95 pushed a commit that referenced this pull request Oct 23, 2024
This patch adds a new utility function which provides human-readable
string description of the given system error code.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #54075
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
@aduh95 aduh95 mentioned this pull request Oct 24, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
This patch adds a new utility function which provides human-readable
string description of the given system error code.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: nodejs#54075
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.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++. libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants