Python is RuntimeError acceptable for general use

0 votes

Is it acceptable to use the RuntimeError exception for general application use?

raise RuntimeError('config file is missing host address')

I've got some code with a couple of one-off situations like this and would prefer to avoid creating one-off exception classes for each of them. All the situations are fatal, and my goal is to get a clear message to the console. Basically I'm looking for something similar to the deprecated

raise 'config file is missing host address'
Jan 10, 2023 in Python by erzan
• 630 points

edited 4 days ago 12 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP