Is there a better way of doing something like this:
class SpecialError(Exception):
pass
try:
# Some code that might fail
a = float(a)
# Some condition I want to check
if a < 0:
raise SpecialError
except (ValueError, SpecialError):
# This code should be run if the code fails
# or the condition is not met
a = 999.