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 a Task with duplicate task_id is defined in the same DAG"""
class SerializedDagNotFound(DagNotFound):
    """Raise when DAG is not found in the serialized_dags table in DB"""
class SerializationError(AirflowException):
    """A problem occurred when trying to serialize a DAG"""
class TaskNotFound(AirflowNotFoundException):
    """Raise when a Task is not available in the system"""
class TaskInstanceNotFound(AirflowNotFoundException):
    """Raise when a Task Instance is not available in the system"""
class PoolNotFound(AirflowNotFoundException):
    """Raise when a Pool is not available in the system"""
class NoAvailablePoolSlot(AirflowException):
    """Raise when there is not enough slots in pool"""
class DagConcurrencyLimitReached(AirflowException):
    """Raise when DAG max_active_tasks limit is reached"""
class TaskConcurrencyLimitReached(AirflowException):
    """Raise when task max_active_tasks limit is reached"""
class BackfillUnfinished(AirflowException):
    """
    Raises when not all tasks succeed in backfill.
    :param message: The human-readable description of the exception
    :param ti_status: The information about all task statuses
    """
    def __init__(self, message, ti_status):
        super().__init__(message)
        self.ti_status = ti_status
class FileSyntaxError(NamedTuple):