Closed edenhaus closed 3 months ago
The update improves error handling in deebot_client
by ensuring the codes
data is a list before processing. If codes
is not a list, the function returns a specific result. This change addresses an issue where getError
messages with an empty list caused errors. Test cases were also updated to reflect these changes.
Files/Modules | Change Summary |
---|---|
deebot_client/commands/json/error.py |
Enhanced error handling by ensuring codes is a list and added a default error parameter to _handle_body_data_dict . |
tests/commands/json/test_error.py |
Modified test cases to use a dictionary for the input body instead of an integer code, adjusting test logic accordingly. |
Objective | Addressed | Explanation |
---|---|---|
Ensure codes data is handled as a list before processing (#501) |
✅ | |
Modify test cases to reflect the changes in error handling | ✅ |
In code's embrace, we found the way,
To handle errors, come what may.
With lists in hand and tests anew,
Our Deebot's path is clear and true.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes https://github.com/DeebotUniverse/client.py/issues/501
Summary by CodeRabbit
Bug Fixes
codes
data, ensuring it is a list before further processing.Tests