Add ApplicationNotAllowedException and update related tests#1963
Merged
Add ApplicationNotAllowedException and update related tests#1963
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the client’s error-to-exception mapping to recognize a specific RESOURCE_ACCESS_DENIED scenario (“Your setup cannot be accessed through this application”) and adds a corresponding test fixture to validate the new behavior.
Changes:
- Added
ApplicationNotAllowedException(and introduced aResourceAccessDeniedExceptionbase class for related errors). - Updated
OverkizClient.check_response()to raiseApplicationNotAllowedExceptionfor the new cloud error message. - Added a new cloud exception fixture and expanded the parameterized client exception tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pyoverkiz/exceptions.py |
Adds new exception types and refactors some existing exceptions under a shared ResourceAccessDeniedException base. |
pyoverkiz/client.py |
Maps the new cloud error message to ApplicationNotAllowedException. |
tests/test_client.py |
Adds a new parameterized test case to assert the new exception is raised. |
tests/fixtures/exceptions/cloud/resource-access-denied.json |
Adds fixture payload for the new RESOURCE_ACCESS_DENIED error message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tetienne
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ResourceAccessDeniedException, and updatedNotAuthenticatedException,MissingAuthorizationTokenException, andAccessDeniedToGatewayExceptionto inherit from it for better error categorization. [1] [2] [3]New exception for application access denial:
ApplicationNotAllowedException(inheriting fromResourceAccessDeniedException) for handling cases when the API returns a "RESOURCE_ACCESS_DENIED" error with the message "Your setup cannot be accessed through this application". [1] [2] [3]Test and fixture updates:
cloud/resource-access-denied.json) and updated tests to verify thatApplicationNotAllowedExceptionis raised for the appropriate error response. [1] [2]