Error Detection within a Specific Time Horizon and Application to Air Traffic Management