python re-raise exception code example
Example 1: python reraise
try:
something()
except SomeError as e:
try:
plan_B()
except AlsoFailsError:
raise e # or raise e from None - see below
Example 2: python: raise error
class MyError(TypeError):
pass
raise MyError('An error happened')