* Add user-friendly error handling for file not found errors
Handle ENOENT errors with clear, actionable messages instead of raw error
codes. These are environmental issues where users reference files or
directories that don't exist, so we suppress Sentry reporting and show
the missing path with helpful guidance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Mark macOS version errors as UserError in CLI package
Updates the CLI package to throw UserError instead of generic Error for
macOS version compatibility issues. This ensures version incompatibility
errors are properly classified as user-facing errors that shouldn't be
reported to Sentry.
Also includes changeset for this change.
* Update packages/wrangler/src/core/handle-errors.ts
Co-authored-by: Ben <4991309+NuroDev@users.noreply.github.com>
* Improve error message when creating duplicate KV namespace
When attempting to create a KV namespace that already exists, provide
a clear, user-friendly error message instead of the generic API error.
The new message explains that the namespace already exists and suggests
running `wrangler kv namespace list` to see existing namespaces with
their IDs, or choosing a different namespace name.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* user error in env types
* Improve error handling for Vite config transformations
Replace assertions with proper error handling when transforming Vite
configs. When Wrangler encounters a Vite config that uses a function
or lacks a plugins array, it now provides clear, actionable error
messages instead of crashing with assertion failures.
The check function gracefully skips incompatible configs with debug
logging, while the transform function throws helpful UserError messages
with examples of how to manually add the Cloudflare plugin.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix Wrangler test failures
- Fix vite-config tests by setting logger level to debug to capture debug messages
- Update snapshots for FormData boundary formatting changes in deploy and pages tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* wording
* Add FormData boundary normalization for cross-platform test consistency
Adds normalization code to ensure FormData boundaries format consistently
across different platforms (macOS vs Linux) in test snapshots.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Suppress network fetch errors from Sentry and show user-friendly messages
Add handling for "fetch failed" / "Failed to fetch" TypeError exceptions
to prevent them from being sent to Sentry and instead display helpful
error messages to users about network connectivity issues.
Changes:
- Add isNetworkFetchFailedError() function in handle-errors.ts to detect
generic network fetch failures
- Display user-friendly error message explaining common network issues
- Mark these errors as non-reportable to Sentry (environmental issues)
- Update sentry tests to use API errors instead of network errors for
testing reportable error behavior
- Add test coverage for network error suppression
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix tests
* fix tests
* fix tests
* remove duplicate calls
* format
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ben <4991309+NuroDev@users.noreply.github.com>
* Add helper function to show or hide the cursor
* Watch cli directory in wrangler "dev" script
* containers: ssh UX improvements
Fix a few papercuts with the new container ssh command:
* Provide single-letter aliases for common SSH options (`-F` to specify
a config file, `-o` to specify options, `-i` to set the private key)
* Allow `-o` to be used multiple times for setting multiple options
* Show the cursor when the SSH process starts. The library that
Wrangler uses to draw the interactive UI (clack) hides the cursor, so
it is not visible when the SSH shell starts. We need to manually make
it visible.
* Hard code some specific SSH options (ControlMaster, ControlPersist,
UserKnownHostsFile, and StrictHostKeyChecking). These don't make sense
to use with the way our SSH implementation works