kaxil commented on code in PR #45043:
URL: https://github.com/apache/airflow/pull/45043#discussion_r1891177139
##########
task_sdk/src/airflow/sdk/exceptions.py:
##########
@@ -14,3 +14,24 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+from __future__ import annotations
+
+import enum
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from airflow.sdk.execution_time.comms import ErrorResponse
+
+
+class AirflowRuntimeError(Exception):
+ def __init__(self, error: ErrorResponse):
+ self.error = error
+ super().__init__(f"{error.error.value}: {error.detail}")
Review Comment:
>Also a sort of nit: by having the raise inside this function the first item
on the call stack is going to be this which will make the source of the error
somewhat.
oh yes, I just removed the convenient `raise_as_exception` method on
`ErrorResponse` -- and instead did the following:
https://github.com/apache/airflow/blob/2937a0cd5a16844e2604bc0bb7bc8a9698c12102/task_sdk/src/airflow/sdk/execution_time/context.py#L48-L50
--
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]