try:
1 / 0
except ZeroDivisionError as e:
raise ValueError("Cannot divide by zero")
try:
1 / 0
except ZeroDivisionError as e:
raise ValueError("Cannot divide by zero") from e
When you raise a new exception after another exception was caught it’s likely that the second exception is a friendly re-wrapping of the first exception.