fix: map EBADPLATFORM and Git SSH auth failures to UnsupportedPackageError (422) - #104
Merged
Merged
Conversation
…Error Platform architecture mismatches (e.g. @esbuild/android-arm wanted os: android, cpu: arm) and unresolvable private Git SSH repositories (Permission denied publickey) previously threw an unhandled InstallError (surfaced as HTTP 500). 1. Add isUnsupportedPackage helper in installation.utils.ts to match EBADPLATFORM, Unsupported platform, ERR_PNPM_UNSUPPORTED_PLATFORM, unsupported architecture, and Git SSH permission denied output. 2. Throw UnsupportedPackageError (mapped to HTTP 422) instead of InstallError (HTTP 500). 3. Add unsupported-platform test fixture and mock unit tests + slow integration test.
pastelsky
force-pushed
the
fix/classify-unsupported-platform-errors
branch
from
August 10, 2026 16:07
325eeb3 to
da102c7
Compare
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.
Problem
Packages with target platform/CPU constraints (e.g.
@esbuild/android-armspecifying"os": ["android"], "cpu": ["arm"]) or private Git SSH repositories (ls-remote ssh://git@github.com/...) failed during installation withcode EBADPLATFORMorPermission denied (publickey).Previously,
InstallationUtilscaught these process failures and threwInstallError(surfaced as an HTTP 500 server crash).Solution
isUnsupportedPackagehelper insrc/utils/installation.utils.tsto match:code EBADPLATFORMUnsupported platformERR_PNPM_UNSUPPORTED_PLATFORMunsupported architecturePermission denied (publickey)/fatal: Could not read from remote repository)UnsupportedPackageError(which maps cleanly to HTTP 422 Unprocessable Entity) instead ofInstallError(HTTP 500).tests/fast/installation.utils.test.tsand an integration test intests/slow/error-handling.test.tsverifying@esbuild/android-arm@0.28.1throwsUnsupportedPackageError.Verification
corepack yarn test)corepack yarn vitest run tests/slow/error-handling.test.ts)corepack yarn check)