Skip to content

Raise OSError for UDP server startup failures - #323

Merged
mhils merged 2 commits into
mitmproxy:mainfrom
Sonike:fix/socket-bind-oserror
Sep 30, 2026
Merged

mhils merged 2 commits into
mitmproxy:mainfrom
Sonike:fix/socket-bind-oserror

Conversation

@Sonike

@Sonike Sonike commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • convert std::io::Errors wrapped by anyhow into Python OSErrors at the UDP and WireGuard server boundaries
  • preserve the raw OS errno so mitmproxy can recognize EADDRINUSE and show its existing actionable port suggestion
  • add a regression test using a real address-in-use error and document the change

Fixes mitmproxy/mitmproxy#7650.

Test plan

  • cargo fmt --all --check
  • cargo clippy -p mitmproxy_rs --all-targets -- -D warnings
  • cargo test -p mitmproxy_rs

This change was prepared with Codex assistance and verified locally.

@mhils mhils left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the great PR! 馃槂

Comment thread mitmproxy-rs/src/util.rs Outdated
@mhils
mhils enabled auto-merge (squash) September 30, 2026 23:38
@mhils
mhils merged commit 9102557 into mitmproxy:main Sep 30, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error message for WireGuard port conflict

2 participants