If we made [AirflowNotFound](https://github.com/apache/airflow/blob/master/airflow/exceptions.py#L43-L46) inherit from [connextion.NotFound](https://github.com/apache/airflow/blob/master/airflow/api_connexion/exceptions.py#L75-L83) this code could be a simpler [here](https://github.com/apache/airflow/blob/690e80b82b12ab1d7232d6f02ea6bddd1d71750c/airflow/api_connexion/endpoints/task_instance_endpoint.py#L290-L297).


_Originally posted by @ashb in https://github.com/apache/airflow/pull/11335#discussion_r511863077_
airflow/exceptions.py
"""Raise when the task should be failed without retrying"""
class AirflowDagCycleException(AirflowException):
    """Raise when there is a cycle in Dag definition"""
class AirflowDagDuplicatedIdException(AirflowException):
    """Raise when a Dag's ID is already used by another Dag"""
    def __init__(self, dag_id: str, incoming: str, existing: str) -> None:
        super().__init__(dag_id, incoming, existing)
        self.dag_id = dag_id
        self.incoming = incoming
        self.existing = existing
    def __str__(self) -> str:
        return f"Ignoring DAG {self.dag_id} from {self.incoming} - also found in {self.existing}"
class AirflowClusterPolicyViolation(AirflowException):
    """Raise when there is a violation of a Cluster Policy in Dag definition"""
class AirflowTimetableInvalid(AirflowException):
    """Raise when a DAG has an invalid timetable."""
class DagNotFound(AirflowNotFoundException):
    """Raise when a DAG is not available in the system"""
class DagCodeNotFound(AirflowNotFoundException):
    """Raise when a DAG code is not available in the system"""
class DagRunNotFound(AirflowNotFoundException):
    """Raise when a DAG Run is not available in the system"""
class DagRunAlreadyExists(AirflowBadRequest):
    """Raise when creating a DAG run for DAG which already has DAG run entry"""
class DagFileExists(AirflowBadRequest):
    """Raise when a DAG ID is still in DagBag i.e., DAG file is in DAG folder"""
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        warnings.warn("DagFileExists is deprecated and will be removed.", DeprecationWarning, stacklevel=2)
class DuplicateTaskIdFound(AirflowException):