You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix nonce, add auto retry on auth exception, fix session id int, improve code quality (#336)
This pull request includes several changes to improve error handling,
enhance functionality, and update configurations. The most important
changes include adding new exception handling for invalid sessions,
updating the `postCreateCommand` in the devcontainer, and adding custom
funding options.
### Error Handling Improvements:
* Added `InvalidSessionException` to handle invalid session errors and
updated relevant methods to raise this exception when needed
(`sagemcom_api/client.py`, `sagemcom_api/const.py`,
`sagemcom_api/exceptions.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R32)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R46)
[[3]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R220-R225)
[[4]](diffhunk://#diff-57cf505b5e01fc69f170c5a1b839fb40b45a97a9c0ebc1fe53f4bd524ae9ac04R10)
[[5]](diffhunk://#diff-63c847110513149341a9f7e94d412bfb7c67d79df07a321774a9a2f3329ca34fR4-L43)
* Introduced `retry_login` function to retry login on specific
exceptions using backoff (`sagemcom_api/client.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R58-R62)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R260-R270)
### Functional Enhancements:
* Modified `get_hosts` method to include `capability-flags` in the
options for retrieving hosts (`sagemcom_api/client.py`).
* Corrected the nonce generation logic to use the correct range
(`sagemcom_api/client.py`).
### Configuration Updates:
* Updated `postCreateCommand` in `.devcontainer/devcontainer.json` to
include `pre-commit install-hooks` for better pre-commit setup.
* Added a custom funding option in `.github/FUNDING.yml` to include a
PayPal link.
0 commit comments