Skip to content

src: improve error message for invalid child stdio type in spawn_sync - #57589

Closed
dario-piotrowicz wants to merge 1 commit into
nodejs:mainfrom
dario-piotrowicz:dario/spawn_sync_invalid_child_stdio_type_error_message
Closed

src: improve error message for invalid child stdio type in spawn_sync#57589
dario-piotrowicz wants to merge 1 commit into
nodejs:mainfrom
dario-piotrowicz:dario/spawn_sync_invalid_child_stdio_type_error_message

Conversation

@dario-piotrowicz

Copy link
Copy Markdown
Member

This is pretty minor, but as I was looking into #52776 (which I still am) and I noticed that the current error message that users see is not super helpful:

 # Assertion failed: "Unreachable code reached" __VA_OPT__(": ") "invalid child stdio type"

What I'm doing in here is simply updating this so that instead what the user sees the following:

invalid child stdio type: wrap
# <node binary location>[192863]: v8::Maybe<int> node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>) at ../src/spawn_sync.cc:1061
# Assertion failed: "Unreachable code reached"

(where wrap is the problematic stdio type I get for #52776)

I'm not really good at C++ (I'm still learning), so if there is a better way of doing the above I would really love
some suggestions 🙂

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. labels Mar 22, 2025
@codecov

codecovBot commented Mar 22, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.24%. Comparing base (86f86a2) to head (d7cf57b).
Report is 12 commits behind head on main.

Files with missing linesPatch %Lines
src/spawn_sync.cc0.00%3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #57589 +/- ##
==========================================
+ Coverage 90.22% 90.24% +0.01% 
==========================================
Files 630 630 Lines 185481 185483 +2 Branches 36364 36366 +2 ==========================================
+ Hits 167357 167382 +25 + Misses 11004 10992 -12 + Partials 7120 7109 -11 
Files with missing linesCoverage Δ
src/spawn_sync.cc68.57% <0.00%> (-0.19%)⬇️

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig
anonrig requested review from anonrig and jasnell and removed request for jasnellMarch 24, 2025 20:07
@anonriganonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. review wanted PRs that need reviews. labels Mar 24, 2025
@anonrig

Copy link
Copy Markdown
Member

cc @nodejs/cpp-reviewers

@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@dario-piotrowicz
dario-piotrowiczforce-pushed the dario/spawn_sync_invalid_child_stdio_type_error_message branch from fb26425 to d7cf57bCompareApril 12, 2025 15:46
@nodejs-github-bot

nodejs-github-bot commented Apr 12, 2025

Copy link
Copy Markdown
Collaborator

jasnell pushed a commit that referenced this pull request Apr 13, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in a4843f4

@jasnelljasnell closed this Apr 13, 2025
@dario-piotrowicz
dario-piotrowicz deleted the dario/spawn_sync_invalid_child_stdio_type_error_message branch April 13, 2025 17:20
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 18, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@ghostghost mentioned this pull request Jun 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.child_processIssues and PRs related to the child_process subsystem.needs-ciPRs that need a full CI run.review wantedPRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@dario-piotrowicz@anonrig@nodejs-github-bot@jasnell@joyeecheung@Ethan-Arrowood@RafaelGSS