dondaum commented on code in PR #38787:
URL: https://github.com/apache/airflow/pull/38787#discussion_r1554570741


##########
airflow/providers/alibaba/cloud/hooks/oss.py:
##########
@@ -338,30 +338,30 @@ def get_credential(self) -> oss2.auth.Auth:
         extra_config = self.oss_conn.extra_dejson
         auth_type = extra_config.get("auth_type", None)
         if not auth_type:
-            raise Exception("No auth_type specified in extra_config. ")
+            raise ValueError("No auth_type specified in extra_config. ")
 
         if auth_type != "AK":
-            raise Exception(f"Unsupported auth_type: {auth_type}")
+            raise TypeError(f"Unsupported auth_type: {auth_type}")

Review Comment:
   Thanks good point. Changed.



##########
airflow/providers/alibaba/cloud/hooks/oss.py:
##########
@@ -338,30 +338,30 @@ def get_credential(self) -> oss2.auth.Auth:
         extra_config = self.oss_conn.extra_dejson
         auth_type = extra_config.get("auth_type", None)
         if not auth_type:
-            raise Exception("No auth_type specified in extra_config. ")
+            raise ValueError("No auth_type specified in extra_config. ")
 
         if auth_type != "AK":
-            raise Exception(f"Unsupported auth_type: {auth_type}")
+            raise TypeError(f"Unsupported auth_type: {auth_type}")
         oss_access_key_id = extra_config.get("access_key_id", None)
         oss_access_key_secret = extra_config.get("access_key_secret", None)
         if not oss_access_key_id:
-            raise Exception(f"No access_key_id is specified for connection: 
{self.oss_conn_id}")
+            raise ValueError(f"No access_key_id is specified for connection: 
{self.oss_conn_id}")
 
         if not oss_access_key_secret:
-            raise Exception(f"No access_key_secret is specified for 
connection: {self.oss_conn_id}")
+            raise ValueError(f"No access_key_secret is specified for 
connection: {self.oss_conn_id}")
 
         return oss2.Auth(oss_access_key_id, oss_access_key_secret)
 
     def get_default_region(self) -> str:
         extra_config = self.oss_conn.extra_dejson
         auth_type = extra_config.get("auth_type", None)
         if not auth_type:
-            raise Exception("No auth_type specified in extra_config. ")
+            raise ValueError("No auth_type specified in extra_config. ")
 
         if auth_type != "AK":
-            raise Exception(f"Unsupported auth_type: {auth_type}")
+            raise TypeError(f"Unsupported auth_type: {auth_type}")

Review Comment:
   Thanks good point. Changed.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to