fix: surface a clear error message when a package upload exceeds the server size limit - #761
Merged
Merged
Conversation
…server size limit Previously a 413 response from the server fell through to the generic error branch, giving the user an opaque message containing only the HTTP status code. Added a dedicated case 413 that tells the user the package is too large and suggests either reducing the size or asking a server administrator to raise the limit. Added a test that starts the service with a 1-byte pkgMaxFileSize to confirm the 413 path is exercised and the error message is actionable.
|
🎉 This PR is included in version 3.1.68 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
When a package upload exceeded the server's configured
pkgMaxFileSizelimit, the server responded with 413. The CLI had no special handling for this status code, so it fell through to the generic error branch and showed:The user had no way to tell from this output that the problem was package size.
Fix
Added a dedicated
case 413inupload-files.jsthat produces an actionable message:Test
Added a test in
test/publish.package.test.jsthat starts the service withpkgMaxFileSize: 1(ensuring any upload triggers a 413) and asserts that the thrown error message contains "too large".