airflow/contrib/sensors/ftp_sensor.py
def _get_error_code(self, e):
        """Extract error code from ftp exception"""
        try:
            matches = self.error_code_pattern.match(str(e))
            code = int(matches.group(0))
            return code
        except ValueError:
            return e
def _get_error_code(self, e):
        """Extract error code from ftp exception"""
        try:
            matches = self.error_code_pattern.match(str(e))
            code = int(matches.group(0))
            return code
        except ValueError:
            return e
Extract error code from ftp exception