Reputation: 369
I need to use an overflow error in Python as a condition. I.E. if the overflow error occurs then perform function b, rather than simply halting the program.
I can't find the right keywords to google if this is possible, can anyone point me in the right direction?
Upvotes: 0
Views: 187
Reputation: 42678
Just use a try/except
block:
try:
raise OverflowError("Uuuups")
except OverflowError as e:
do_some_stuff(e)
Here you have a live example
Upvotes: 1