reraise-no-cause (TRY200)
Derived from the tryceratops linter.
Warning: This rule has been removed and its documentation is only available for historical reasons.
Removed
This rule is identical to B904 which should be used instead.
What it does
Checks for exceptions that are re-raised without specifying the cause via
the from
keyword.
Why is this bad?
The from
keyword sets the __cause__
attribute of the exception, which
stores the "cause" of the exception. The availability of an exception
"cause" is useful for debugging.
Example
Use instead: