Skip to content

fix: surface a clear error message when a package upload exceeds the server size limit - #761

Merged
trygve-lie merged 3 commits into
mainfrom
fix/413-upload-too-large-error
Aug 14, 2026
Merged

fix: surface a clear error message when a package upload exceeds the server size limit#761
trygve-lie merged 3 commits into
mainfrom
fix/413-upload-too-large-error

Conversation

@trygve-lie

Copy link
Copy Markdown
Contributor

Problem

When a package upload exceeded the server's configured pkgMaxFileSize limit, 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:

✗ Unable to upload zip file to server
✗ Error: 413: Server failed, Server responded with a non 200 ok status code. Response: 413

The user had no way to tell from this output that the problem was package size.

Fix

Added a dedicated case 413 in upload-files.js that produces an actionable message:

✗ Unable to upload zip file to server
✗ Error: 413: Package is too large to upload. Reduce the package size or ask a server administrator to increase the upload limit.

Test

Added a test in test/publish.package.test.js that starts the service with pkgMaxFileSize: 1 (ensuring any upload triggers a 413) and asserts that the thrown error message contains "too large".

…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.
@trygve-lie
trygve-lie merged commit ebbf83e into main Aug 14, 2026
6 checks passed
@trygve-lie
trygve-lie deleted the fix/413-upload-too-large-error branch August 14, 2026 13:58
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.1.68 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant