Skip to content

miioprotocol: wrap unexpected responses in DeviceException#2081

Open
rytilahti wants to merge 1 commit into
masterfrom
improve-exception-handling
Open

miioprotocol: wrap unexpected responses in DeviceException#2081
rytilahti wants to merge 1 commit into
masterfrom
improve-exception-handling

Conversation

@rytilahti

Copy link
Copy Markdown
Owner

To avoid leaking raw exceptions to downstreams, send() now raises PayloadDecodeException when the device response cannot be decrypted (payload is not a dict), and wraps any other unexpected exception in DeviceException.

Fixes #1913

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.16%. Comparing base (2817647) to head (3a7e326).

Files with missing lines Patch % Lines
miio/miioprotocol.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2081      +/-   ##
==========================================
+ Coverage   84.13%   84.16%   +0.03%     
==========================================
  Files         199      199              
  Lines       20164    20170       +6     
  Branches     1063     1064       +1     
==========================================
+ Hits        16964    16976      +12     
+ Misses       3010     3002       -8     
- Partials      190      192       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@rytilahti rytilahti force-pushed the improve-exception-handling branch from 3b0b40a to 3a7e326 Compare July 5, 2026 14:54
@rytilahti rytilahti added this to the 0.6.0 milestone Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve handling of unexpected device responses

1 participant