From 7750087f56f09a3b2c57c149db8e5ccc18e4a2bd Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Thu, 9 Feb 2023 17:08:00 +0000 Subject: [PATCH] Remove duplicate documentation for `TRY002` (#2692) --- docs/rules/raise_vanilla_class.md | 38 ------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 docs/rules/raise_vanilla_class.md diff --git a/docs/rules/raise_vanilla_class.md b/docs/rules/raise_vanilla_class.md deleted file mode 100644 index dbfb2c35c7..0000000000 --- a/docs/rules/raise_vanilla_class.md +++ /dev/null @@ -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!!") -```