omkar-foss commented on code in PR #65423:
URL: https://github.com/apache/airflow/pull/65423#discussion_r3213680100
##########
task-sdk/src/airflow/sdk/exceptions.py:
##########
@@ -33,6 +33,26 @@
from airflow.sdk.execution_time.comms import ErrorResponse
+class AirflowErrorCodeMixin:
+ """Mixin class providing ability to pass error_code to an exception."""
+
+ def __init__(self, *args, error_code=None, **kwargs):
+ self.error_code = error_code
+ super().__init__(*args, **kwargs)
+
+ def __str__(self):
+ base = super().__str__()
+ if self.error_code is None:
+ return base
+ error_code_str = f"[airflow error code={self.error_code}]"
Review Comment:
Done
--
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]