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 requested object/resource is not available in the system"""
    status_code = 404
class AirflowConfigException(AirflowException):
    """Raise when there is configuration problem"""
class AirflowSensorTimeout(AirflowException):
    """Raise when there is a timeout on sensor polling"""
class AirflowRescheduleException(AirflowException):
    """
    Raise when the task should be re-scheduled at a later time.
    :param reschedule_date: The date when the task should be rescheduled
    :type reschedule_date: datetime.datetime
    """
    def __init__(self, reschedule_date):
        super().__init__()
        self.reschedule_date = reschedule_date
class AirflowSmartSensorException(AirflowException):
    """
    Raise after the task register itself in the smart sensor service
    It should exit without failing a task
    """
class InvalidStatsNameException(AirflowException):
    """Raise when name of the stats is invalid"""
class AirflowTaskTimeout(AirflowException):
    """Raise when the task execution times-out"""
class AirflowWebServerTimeout(AirflowException):
    """Raise when the web server times out"""
class AirflowSkipException(AirflowException):
    """Raise when the task should be skipped"""
class AirflowFailException(AirflowException):