I’m extending PDO and I want to throw exceptions from it. Should I make my own exception class that is not inherited from PDOException, throw PDOException or throw a class inherited from PDOException?
Share
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.
If your exception does not contain any extra data or custom properties, just throw the original
PDOException, as you have no reason to extend it.