I’m writing a parser for a certain file format. If a file is not correctly formatted (and can not be parsed) then the parser throws an exception.
What exception class, in the Python 2 exception hierarchy, should I use?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about
where
XyzParseris the name of your parser class? That’s also whatHTMLParserin the standard library does.