In Python, I've read that it's better (and easier) to catch execptions, rather than check first, so that's what I'm trying to do.
My script opens and parses an XMLs file using
xml.dom.minidom.parse(xml_file_path)
so I'm catching
xml.parsers.expat.ExpatError
but if the file doesn't exist, I get a FileNotFoundError exception, so I obviously need to catch that too.
I know that I shouldn't really be catching all exceptions, but how can I know what exceptions I should be catching for a function like parse()?