pylint-errors

W0707 (raise-missing-from)

:x: Problematic code:

try:
    1 / 0
except ZeroDivisionError as e:
    raise ValueError("Cannot divide by zero")

:heavy_check_mark: Correct code:

try:
    1 / 0
except ZeroDivisionError as e:
    raise ValueError("Cannot divide by zero") from e

Rationale:

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.