Derived from the tryceratops linter.
What it does#
raise statements within
try blocks. The only
caught are those that throw exceptions caught by the
try statement itself.
Why is this bad?#
Raising and catching exceptions within the same
try block is redundant,
as the code can be refactored to avoid the
try block entirely.
raise can be moved within an inner function, making
the exception reusable across multiple call sites.