Browse Source

tooncher._login: raise `RuntimeError` instead of `Exception` when server sends unexpected/unsupported response (fixing pylint's broad-exception-raised warning)

https://github.com/fphammerle/tooncher/commit/df8bf17a28ad94e33212e89dcb75ef38f1800b54
https://github.com/fphammerle/python-cc1101/commit/49ea3820ffb845ca707ccaa7d3bfb783ac287fbf
https://github.com/fphammerle/acpi-backlight/commit/808f905cf6f0ed2dadbde7a79fb8d1a99bb9093e
Fabian Peter Hammerle 1 year ago
parent
commit
bb81c11305
2 changed files with 3 additions and 1 deletions
  1. 2 0
      CHANGELOG.md
  2. 1 1
      tooncher/__init__.py

+ 2 - 0
CHANGELOG.md

@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 - raise `ValueError` instead of `Exception` when incompatible combination of
   arguments was given
+- raise `RuntimeError` instead of `Exception` when server send
+  unexpected / unsupported response
 
 ### Removed
 - compatibility with `python3.5` & `python3.6`

+ 1 - 1
tooncher/__init__.py

@@ -110,7 +110,7 @@ def _login(
         )
     if resp_data["success"] == "delayed":
         return _LoginDelayed(queue_token=resp_data["queueToken"])
-    raise Exception(repr(resp_data))
+    raise RuntimeError(repr(resp_data))
 
 
 def launch(