[tryceratops] Add fix for error-instead-of-exception (TRY400) (#9520)

## Summary

add autofix for `error-instead-of-exception` (`TRY400`)

## Test Plan

`cargo test`
This commit is contained in:
Steve C 2024-01-15 22:00:04 -05:00 committed by GitHub
parent 2bddde2627
commit 7ef7e0ddb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 316 additions and 6 deletions

View file

@ -64,7 +64,7 @@ pub fn is_logger_candidate(
false
}
/// If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`,
/// If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`,
/// return the `Keyword` for `exc_info`.
pub fn exc_info<'a>(arguments: &'a Arguments, semantic: &SemanticModel) -> Option<&'a Keyword> {
let exc_info = arguments.find_keyword("exc_info")?;