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: improve error message for invalid child stdio type in spawn_sync #57589

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Contributor

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 🙂

Verified

This commit was signed with the committer’s verified signature.
AzureMarker Mark Drobnak
@nodejs-github-bot nodejs-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
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

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

Project coverage is 90.24%. Comparing base (ffc1cf6) to head (fb26425).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
src/spawn_sync.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57589      +/-   ##
==========================================
+ Coverage   90.22%   90.24%   +0.01%     
==========================================
  Files         630      630              
  Lines      185149   185151       +2     
  Branches    36236    36241       +5     
==========================================
+ Hits       167058   167090      +32     
+ Misses      11035    11027       -8     
+ Partials     7056     7034      -22     
Files with missing lines Coverage Δ
src/spawn_sync.cc 68.57% <0.00%> (-0.19%) ⬇️

... and 22 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 jasnell and anonrig and removed request for jasnell March 24, 2025 20:07
@anonrig anonrig 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
Member

anonrig commented Mar 24, 2025

cc @nodejs/cpp-reviewers

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

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++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants