Skip to content

Commit

Permalink
feat(gcp): rename exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrooot committed Dec 13, 2024
1 parent 1e8fdaa commit 4cca0dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions prowler/providers/gcp/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GCPBaseException(ProwlerException):
"message": "Error testing connection to GCP",
"remediation": "Check the connection and ensure it is properly set up.",
},
(3006, "GCPLoadCredentialsFromDictError"): {
(3006, "GCPLoadCredentialsFromADCError"): {
"message": "Error loading credentials from dictionary",
"remediation": "Check the credentials and ensure they are properly set up. client_id, client_secret and refresh_token are required.",
},
Expand Down Expand Up @@ -115,7 +115,7 @@ def __init__(self, file=None, original_exception=None, message=None):
)


class GCPLoadCredentialsFromDictError(GCPCredentialsError):
class GCPLoadCredentialsFromADCError(GCPCredentialsError):
def __init__(self, file=None, original_exception=None, message=None):
super().__init__(
3006, file=file, original_exception=original_exception, message=message
Expand Down
10 changes: 5 additions & 5 deletions prowler/providers/gcp/gcp_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
GCPGetProjectError,
GCPHTTPError,
GCPInvalidProviderIdError,
GCPLoadCredentialsFromDictError,
GCPLoadCredentialsFromADCError,
GCPLoadCredentialsFromServiceAccountKeyError,
GCPNoAccesibleProjectsError,
GCPSetUpSessionError,
Expand Down Expand Up @@ -112,7 +112,7 @@ def __init__(
Raises:
GCPNoAccesibleProjectsError if no project IDs can be accessed via Google Credentials
GCPSetUpSessionError if an error occurs during the setup session
GCPLoadCredentialsFromDictError if an error occurs during the loading credentials from dict
GCPLoadCredentialsFromADCError if an error occurs during the loading credentials from dict
GCPGetProjectError if an error occurs during the get project
Returns:
Expand Down Expand Up @@ -345,7 +345,7 @@ def setup_session(
Credentials object and default project ID
Raises:
GCPLoadCredentialsFromDictError if an error occurs during the loading credentials from dict
GCPLoadCredentialsFromADCError if an error occurs during the loading credentials from dict
GCPLoadCredentialsFromServiceAccountKeyError if an error occurs during the loading credentials from the service account key
GCPSetUpSessionError if an error occurs during the setup session
Expand All @@ -370,7 +370,7 @@ def setup_session(
logger.critical(
f"{error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
raise GCPLoadCredentialsFromDictError(
raise GCPLoadCredentialsFromADCError(
file=__file__, original_exception=error
)

Expand Down Expand Up @@ -454,7 +454,7 @@ def test_connection(
Connection object with is_connected set to True if the connection is successful, or error set to the exception if the connection fails
Raises:
GCPLoadCredentialsFromDictError if an error occurs during the loading credentials from dict
GCPLoadCredentialsFromADCError if an error occurs during the loading credentials from dict
GCPLoadCredentialsFromServiceAccountKeyError if an error occurs during the loading credentials from dict
GCPSetUpSessionError if an error occurs during the setup session
GCPCloudResourceManagerAPINotUsedError if the Cloud Resource Manager API has not been used before or it is disabled
Expand Down

0 comments on commit 4cca0dc

Please sign in to comment.