fix(util): validate system error helpers#3500
Merged
proggeramlug merged 1 commit intoMay 31, 2026
Merged
Conversation
This was referenced May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
util.getSystemErrorName(err)andutil.getSystemErrorMessage(err)inputs with Node-shapedERR_INVALID_ARG_TYPE/ERR_OUT_OF_RANGEbehaviorgetSystemErrorMap()has Node's 85-entry shape and the expectedEFTYPE/EUNATCH/EREMOTEIO/ENONETkeysIssues
Closes #3022
Refs #2514
Why This Cut
The validation gap and the existing
node-suite/util/get-system-errormap-size mismatch share the sameutil_syserrlookup path and one deterministic parity fixture. The broader #2514 tracker remains open for unrelated util helpers.Tests Added
test-parity/node-suite/util/get-system-error.tswith invalid input validation, unsafe integer handling, and Linux libuv alias/map-size probesutil_syserrRust unit coverage for range-number formatting and Linux libuv alias entriesVerification
test-parity/reports/parity_report_20260531_005655.jsontest-parity/reports/parity_report_20260531_011354.jsontest-parity/reports/parity_report_20260531_011516.jsonTMPDIR="$PWD/target/tmp" RUSTC_WRAPPER= cargo test -p perry-runtime util_syserrpassed with existing warningsTMPDIR="$PWD/target/tmp" CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo check -p perry-runtime -p perry-codegen -p perry-api-manifestpassed with existing warningscargo fmt --all -- --checkgit diff --check HEAD./scripts/check_file_size.shKnown Limitations
Non-goals
util.debuglog,util.diff,util.parseEnv, MIME helpers, or othernode:utilAPIs.