refactor backward compatibility for FileNotFoundError exception