You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/07 23:40:30 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #24898: Refactor and fix AWS secret manager invalid exception

potiuk commented on code in PR #24898:
URL: https://github.com/apache/airflow/pull/24898#discussion_r916353226


##########
airflow/providers/amazon/aws/secrets/secrets_manager.py:
##########
@@ -257,15 +258,32 @@ def _get_secret(self, path_prefix, secret_id: str) -> Optional[str]:
             return response.get('SecretString')
         except self.client.exceptions.ResourceNotFoundException:
             self.log.debug(
-                "An error occurred (ResourceNotFoundException) when calling the "
-                "get_secret_value operation: "
+                f"ResourceNotFoundException: {error_msg}: "
                 "Secret %s not found.",
                 secret_id,
             )
             return None
-        except self.client.exceptions.AccessDeniedException:
+        except self.client.exceptions.InvalidParameterException:
             self.log.debug(
-                "An error occurred (AccessDeniedException) when calling the get_secret_value operation",
+                f"InvalidParameterException: {error_msg}",
+                exc_info=True,
+            )
+            return None
+        except self.client.exceptions.InvalidRequestException:
+            self.log.debug(
+                f"InvalidRequestException: {error_msg}",

Review Comment:
   Right!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org