Skip to content

src: remove unnecessary std::string error messages - #60057

Closed
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:no-constant-std-string-format-arg-for-throw
Closed

src: remove unnecessary std::string error messages#60057
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:no-constant-std-string-format-arg-for-throw

Conversation

@addaleax

Copy link
Copy Markdown
Member

If we can just use the classic THROW_...() methods directly, without needing to allocate an std::string for the message/format parameter, let's just do so.

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Sep 28, 2025
If we can just use the classic `THROW_...()` methods directly,
without needing to allocate an `std::string` for the message/format
parameter, let's just do so.
@addaleax
addaleaxforce-pushed the no-constant-std-string-format-arg-for-throw branch from 5d554db to 1440e19CompareSeptember 28, 2025 12:46
@codecov

codecovBot commented Sep 28, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.46%. Comparing base (c6316f9) to head (1440e19).
⚠️ Report is 12 commits behind head on main.

Files with missing linesPatch %Lines
src/node_file.cc77.77%2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #60057 +/- ##
=======================================
Coverage 88.45% 88.46% =======================================
Files 703 703 Lines 207546 207526 -20 Branches 40011 40005 -6 =======================================
- Hits 183591 183578 -13 + Misses 15949 15936 -13 - Partials 8006 8012 +6 
Files with missing linesCoverage Δ
src/node_file.cc75.64% <77.77%> (+0.04%)⬆️

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

@addaleaxaddaleax 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. labels Sep 28, 2025
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

addaleax added a commit that referenced this pull request Sep 30, 2025
If we can just use the classic `THROW_...()` methods directly,
without needing to allocate an `std::string` for the message/format
parameter, let's just do so.
PR-URL: #60057
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in 2e2f4cd

targos pushed a commit that referenced this pull request Oct 6, 2025
If we can just use the classic `THROW_...()` methods directly,
without needing to allocate an `std::string` for the message/format
parameter, let's just do so.
PR-URL: #60057
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
aduh95 pushed a commit that referenced this pull request Oct 22, 2025
If we can just use the classic `THROW_...()` methods directly,
without needing to allocate an `std::string` for the message/format
parameter, let's just do so.
PR-URL: #60057
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
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++.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@addaleax@nodejs-github-bot@jasnell@legendecas@juanarbol