Quantcast
Channel: Possible to raise two types of errors? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by smac89 for Possible to raise two types of errors?

Don't try to throw all the exceptions at once, that's just pointless and serves no other purpose than to properly confuse the user. Either throw one specific exception per error found, or throw a...

View Article



Answer by gilch for Possible to raise two types of errors?

There's really no need to raise two exceptions simultaneously. It's fine to raise the first error you detect. Yes, a TypeError is appropriate if you expected a string but got something else. You can do...

View Article

Possible to raise two types of errors?

So I'm experimenting making my own program. I have the user input a string and an integer (name, age). I want to raise a Value Error if the age is under 1 (if age > 1:) I did that. But I'm not sure...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images