Lee-W commented on code in PR #65423: URL: https://github.com/apache/airflow/pull/65423#discussion_r3167265908
########## airflow-core/docs/error_mapping.yml: ########## @@ -0,0 +1,160 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +--- + +error_guide: + description: Quick debug guide for common errors while using Airflow. + error_codes: + # AERR001: Generic error, should only be raised as a catch-all error, if all else fails. Review Comment: AirflowException should no longer be used, per the previous discussion on the dev list. ########## airflow-core/docs/error_mapping.yml: ########## @@ -0,0 +1,160 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +--- + +error_guide: + description: Quick debug guide for common errors while using Airflow. + error_codes: + # AERR001: Generic error, should only be raised as a catch-all error, if all else fails. Review Comment: old ones might or might not be removed, but no new ones should be added ########## airflow-core/src/airflow/models/connection.py: ########## @@ -527,7 +527,9 @@ def get_connection_from_secrets(cls, conn_id: str, team_name: str | None = None) return conn except AirflowRuntimeError as e: if e.error.error == ErrorType.CONNECTION_NOT_FOUND: - raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't defined") from None + raise AirflowNotFoundException( + f"The conn_id `{conn_id}` isn't defined", error_code="AERR002" Review Comment: Is it possible to embed the error_code in AirflowNotFoundException instead? otherwise, it will be missed in the future -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
