File tree Expand file tree Collapse file tree
crates/ruff_linter/src/rules/flake8_bugbear/rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ use crate::checkers::ast::Checker;
1818/// printing the stack trace, chained exceptions are displayed in such a way
1919/// so as make it easier to trace the exception back to its root cause.
2020///
21- /// When raising an exception from within an `except` clause, always include a
22- /// `from` clause to facilitate exception chaining. If the exception is not
23- /// chained, it will be difficult to trace the exception back to its root cause.
21+ /// When raising a new exception from within an `except` clause, it's recommended to
22+ /// include a `from` clause to explicitly set the exception's cause. Without it,
23+ /// Python will implicitly chain from the current exception (setting `__context__`),
24+ /// but the `__cause__` attribute won't be set, which may make debugging slightly
25+ /// more difficult.
2426///
2527/// ## Example
2628/// ```python
You can’t perform that action at this time.
0 commit comments