Remove duplicate documentation for `TRY002` (#2692)

This commit is contained in:
Nick Pope 2023-02-09 17:08:00 +00:00 committed by GitHub
parent 7d5fb0de8a
commit 7750087f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 38 deletions

View File

@ -1,38 +0,0 @@
# raise-vanilla-class (TRY002)
Derived from the **tryceratops** linter.
### What it does
Checks for bare exceptions.
## Why is this bad?
It's hard to capture generic exceptions making it hard for handling specific scenarios.
## Example
```py
def main_function():
if not cond:
raise Exception()
def consumer_func():
try:
do_step()
prepare()
main_function()
except Exception:
logger.error("I have no idea what went wrong!!")
```
## How it should be
```py
def main_function():
if not cond:
raise CustomException()
def consumer_func():
try:
do_step()
prepare()
main_function()
except CustomException:
logger.error("Main function failed")
except Exception:
logger.error("I have no idea what went wrong!!")
```