Not specifying from
when raising an exception from another gives you no clue
whether the exception (given the circumstances) was intentional or whether it's a bug introduced by the programmer.
def main_function():
try:
process()
handle()
finish()
except Exception:
raise MainFunctionFailed()
def main_function():
try:
process()
handle()
finish()
except Exception as ex:
raise MainFunctionFailed() from ex