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 2021/11/15 18:41:41 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #19324: Catch AccessDeniedException in AWS Secrets Manager Backend

uranusjr commented on a change in pull request #19324:
URL: https://github.com/apache/airflow/pull/19324#discussion_r749588930



##########
File path: airflow/providers/amazon/aws/secrets/secrets_manager.py
##########
@@ -253,3 +253,10 @@ def _get_secret(self, path_prefix, secret_id: str) -> Optional[str]:
                 secret_id,
             )
             return None
+        except self.client.exceptions.AccessDeniedException as e:
+            self.log.debug(
+                "An error occurred (AccessDeniedException) when calling the "
+                "get_secret_value operation: %s",
+                str(e),
+            )

Review comment:
       ```suggestion
           except self.client.exceptions.AccessDeniedException:
               self.log.debug(
                   "An error occurred (AccessDeniedException) when calling the "
                   "get_secret_value operation",
                   exc_info=True,
               )
   ```
   
   `logging` has a built-in way to log an exception! 🙂 




-- 
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