Skip to content

feat(client): wrap MqttError; use KeyError consistently in device() SN lookup#26

Merged
jlopez merged 1 commit intomainfrom
feature/issue-21-exception-hygiene
Feb 28, 2026
Merged

feat(client): wrap MqttError; use KeyError consistently in device() SN lookup#26
jlopez merged 1 commit intomainfrom
feature/issue-21-exception-hygiene

Conversation

@jlopez
Copy link
Owner

@jlopez jlopez commented Feb 28, 2026

  • Add socketry.MqttError (ConnectionError subclass) to replace leaking
    aiomqtt.MqttError from Client.set_property and Device.set_property
  • device() with a string SN now raises KeyError (not IndexError) when
    the device list is empty, matching the behaviour for a missing SN

Fixes: #21

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

…N lookup

- Add socketry.MqttError (ConnectionError subclass) to replace leaking
  aiomqtt.MqttError from Client.set_property and Device.set_property
- device() with a string SN now raises KeyError (not IndexError) when
  the device list is empty, matching the behaviour for a missing SN

Fixes: #21

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jlopez jlopez merged commit 0963f6b into main Feb 28, 2026
4 checks passed
@jlopez jlopez deleted the feature/issue-21-exception-hygiene branch February 28, 2026 16:15
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.

Expose typed exception for MQTT errors; use KeyError consistently in device() SN lookup

1 participant