Re-raising Exceptions
Use bare raise inside an except block to re-raise the current exception after logging or partial handling.
Use bare raise inside an except block to re-raise the current exception after logging or partial handling.
def process():
try:
risky_operation()
except Exception as e:
log_error(e)
raise # re-raise original exception
Bare raise preserves the original traceback; raise e does not.