Skip to content

feat(error): report unusable network interfaces as InterfaceNotFound - #135

Open
stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-tpi2pf-interface-not-found
Open

stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-tpi2pf-interface-not-found

Conversation

@stewartadam

Copy link
Copy Markdown
Contributor

Follow-up to #100 now that #129 has made SacnError #[non_exhaustive].

Change

  • New variant SacnError::InterfaceNotFound(String). set_multicast_interfaces (source and receiver), SacnReceiver::with_interfaces and SacnReceiver::from_socket return it when an interface doesn't exist, or exists but has no address of the socket's IP version. The message names the interface and the reason.
  • Before this PR, those cases returned Io with ErrorKind::NotFound. Io is now reserved for real OS failures: listing interfaces, setting socket options, joining groups.
  • Docs for the affected methods are updated. OsOperationUnsupported's docs no longer give Windows IPv6 multicast as an example, since feat(interface): let callers choose network interfaces for multicast #100 enabled it.

Compatibility

Adding a variant to SacnError is non-breaking since #129. Interface selection (#100) hasn't been in a release yet (latest is v0.12.0), so no released behaviour changes. The title therefore has no !.

Tests

  • The unit tests in src/interface.rs and the two non-ignored interface_selection tests in tests/ipv4_tests.rs now check for InterfaceNotFound.
  • Ran cargo test, Clippy with -D warnings (Linux and x86_64-pc-windows-gnu), and cargo doc with -D warnings.

Generated by Claude Code

An interface given to set_multicast_interfaces, with_interfaces or
from_socket that doesn't exist, or has no address of the socket's IP
version, now returns SacnError::InterfaceNotFound instead of
Io(NotFound). SacnError is non-exhaustive, and interface selection hasn't
been released yet, so no released behaviour changes. Also drop the stale
Windows IPv6 example from OsOperationUnsupported's docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVSfy9eXbfgqTKMEq7P
@stewartadam stewartadam self-assigned this Nov 29, 2026

This branch has not been deployed

No deployments
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.

2 participants