Commit 1ae8daa
authored
Add ApplicationNotAllowedException and update related tests (#1963)
This pull request introduces a new exception,
`ApplicationNotAllowedException`, to handle cases where access to a
setup is denied for a specific application. It also refactors the
exception hierarchy to group related access-denied errors under a new
base class, `ResourceAccessDeniedException`. Additionally, tests and
fixtures are updated to cover the new exception.
Exception hierarchy improvements:
* Introduced a new base exception, `ResourceAccessDeniedException`, and
updated `NotAuthenticatedException`,
`MissingAuthorizationTokenException`, and
`AccessDeniedToGatewayException` to inherit from it for better error
categorization.
[[1]](diffhunk://#diff-0dfa3f77b5b6d197b7ad275059dc5023e18e69b0cb889da6c6de67732257ddeeL32-R36)
[[2]](diffhunk://#diff-0dfa3f77b5b6d197b7ad275059dc5023e18e69b0cb889da6c6de67732257ddeeL64-R68)
[[3]](diffhunk://#diff-0dfa3f77b5b6d197b7ad275059dc5023e18e69b0cb889da6c6de67732257ddeeL100-R111)
New exception for application access denial:
* Added `ApplicationNotAllowedException` (inheriting from
`ResourceAccessDeniedException`) for handling cases when the API returns
a "RESOURCE_ACCESS_DENIED" error with the message "Your setup cannot be
accessed through this application".
[[1]](diffhunk://#diff-0dfa3f77b5b6d197b7ad275059dc5023e18e69b0cb889da6c6de67732257ddeeL100-R111)
[[2]](diffhunk://#diff-11513003e65960c0b1a4bccb3c6bf2b7dea08c03923a8e53b8dea1a05f213aa2R64)
[[3]](diffhunk://#diff-11513003e65960c0b1a4bccb3c6bf2b7dea08c03923a8e53b8dea1a05f213aa2R975-R978)
Test and fixture updates:
* Added a new test fixture (`cloud/resource-access-denied.json`) and
updated tests to verify that `ApplicationNotAllowedException` is raised
for the appropriate error response.
[[1]](diffhunk://#diff-0f9b9c678d1ade309735bdfcbc0d9ad8c6425b6d4d58d3ed017e5a8a9f215928R1-R4)
[[2]](diffhunk://#diff-0d92063e88430a02df61616c5f16b148b64ac4539d9cb9b8d883d5a23351b110R330-R334)1 parent 8d375f4 commit 1ae8daa
File tree
4 files changed
+25
-3
lines changed- pyoverkiz
- tests
- fixtures/exceptions/cloud
4 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
971 | 972 | | |
972 | 973 | | |
973 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
974 | 979 | | |
975 | 980 | | |
976 | 981 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | | - | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | | - | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| |||
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 | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
0 commit comments