Commit 13ca41d
authored
Add ActionGroupSetupNotFoundException and DuplicateActionOnDeviceException (#1919)
This pull request enhances error handling in the Overkiz client by
introducing two new custom exceptions and updating the response checking
logic to catch and raise these exceptions based on specific API error
messages. Additionally, it refines and clarifies the error message
comments for better maintainability.
**Error handling improvements:**
* Added two new exception classes, `DuplicateActionOnDeviceException`
and `ActionGroupSetupNotFoundException`, to `pyoverkiz/exceptions.py`
for handling specific API error cases.
* Updated `pyoverkiz/client.py` to import the new exceptions.
* Modified the `check_response` function in `pyoverkiz/client.py` to
detect error messages indicating a duplicate action on a device or a
missing action group setup, and to raise the corresponding new
exceptions.
**Documentation and code clarity:**
* Updated comments in `check_response` to use consistent JSON-style
formatting for API error messages, improving readability and
maintainability.
[[1]](diffhunk://#diff-11513003e65960c0b1a4bccb3c6bf2b7dea08c03923a8e53b8dea1a05f213aa2L876-R885)
[[2]](diffhunk://#diff-11513003e65960c0b1a4bccb3c6bf2b7dea08c03923a8e53b8dea1a05f213aa2L892-R921)
[[3]](diffhunk://#diff-11513003e65960c0b1a4bccb3c6bf2b7dea08c03923a8e53b8dea1a05f213aa2L935-R944)
Fixes #19181 parent 0aaf7c5 commit 13ca41d
File tree
5 files changed
+44
-9
lines changed- pyoverkiz
- tests
- fixtures/exceptions/local
5 files changed
+44
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
860 | 862 | | |
861 | 863 | | |
862 | 864 | | |
863 | | - | |
864 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
865 | 874 | | |
866 | 875 | | |
867 | 876 | | |
| |||
873 | 882 | | |
874 | 883 | | |
875 | 884 | | |
876 | | - | |
| 885 | + | |
877 | 886 | | |
878 | 887 | | |
879 | 888 | | |
| |||
889 | 898 | | |
890 | 899 | | |
891 | 900 | | |
892 | | - | |
| 901 | + | |
893 | 902 | | |
894 | 903 | | |
895 | 904 | | |
896 | | - | |
| 905 | + | |
897 | 906 | | |
898 | 907 | | |
899 | 908 | | |
900 | | - | |
| 909 | + | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
904 | | - | |
| 913 | + | |
905 | 914 | | |
906 | 915 | | |
907 | 916 | | |
908 | 917 | | |
909 | 918 | | |
910 | 919 | | |
911 | 920 | | |
912 | | - | |
| 921 | + | |
913 | 922 | | |
914 | 923 | | |
915 | 924 | | |
| |||
932 | 941 | | |
933 | 942 | | |
934 | 943 | | |
935 | | - | |
| 944 | + | |
936 | 945 | | |
937 | 946 | | |
938 | 947 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
| |||
0 commit comments