Skip to content

API - Improve error response on missing dag in the dagbag. #48960

Open
@pierrejeambrun

Description

@pierrejeambrun

Body

Improve error handling when accessing dag via the dag bag. The error response should allow user to know if the dag is found in db and failing to deserialize or just missing from the db. Both status code could still be a 404.

In such pattern:

        dag = request.app.state.dag_bag.get_dag(dag_id)
        if not dag:
            raise HTTPException(status.HTTP_404_NOT_FOUND, f"DAG with dag_id: `{dag_id}` was not found")

related #48776

Currently if deserialization fails, it will blow up with a 500 error.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

AIP-84Modern Rest APIarea:APIAirflow's REST/HTTP API

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions