Browse Source

tooncher._login: raise `ValueError` instead of `Exception` when incompatible combination of arguments was given (fixing pylint's broad-exception-raised warning)

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

+ 4 - 0
CHANGELOG.md

@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ## Unreleased
+### Changed
+- raise `ValueError` instead of `Exception` when incompatible combination of
+  arguments was given
+
 ### Removed
 - compatibility with `python3.5` & `python3.6`
 

+ 1 - 1
tooncher/__init__.py

@@ -97,7 +97,7 @@ def _login(
             "queueToken": queue_token,
         }
     else:
-        raise Exception("either specify username or queue token")
+        raise ValueError("either specify username or queue token")
     resp_data = _api_request(
         url=_LOGIN_API_URL,
         params=req_params,