Skip to content

src: improve error handling in cares_wrap #57937

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Apr 19, 2025

Improve error handling in cares_wrap by replacing ToLocalChecked() and Check() calls.
Reduce some code duplication using macros

@jasnell jasnell requested review from anonrig and aduh95 April 19, 2025 22:16
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run. labels Apr 19, 2025
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 19, 2025

Copy link

codecov bot commented Apr 19, 2025

Codecov Report

Attention: Patch coverage is 33.94309% with 325 lines in your changes missing coverage. Please review.

Project coverage is 90.19%. Comparing base (25842c5) to head (d1771d9).

Files with missing lines Patch % Lines
src/cares_wrap.cc 34.08% 246 Missing and 77 partials ⚠️
src/cares_wrap.h 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57937      +/-   ##
==========================================
- Coverage   92.26%   90.19%   -2.07%     
==========================================
  Files         325      630     +305     
  Lines      126673   186174   +59501     
  Branches    20783    36562   +15779     
==========================================
+ Hits       116869   167923   +51054     
- Misses       9576    11066    +1490     
- Partials      228     7185    +6957     
Files with missing lines Coverage Δ
src/cares_wrap.h 78.97% <0.00%> (ø)
src/cares_wrap.cc 54.38% <34.08%> (ø)

... and 410 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.

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++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants