---
source: crates/ruff_linter/src/rules/tryceratops/mod.rs
---
TRY201.py:20:15: TRY201 [*] Use `raise` without specifying exception name
   |
18 |     except MyException as e:
19 |         logger.exception("process failed")
20 |         raise e
   |               ^ TRY201
   |
   = help: Remove exception name

ℹ Unsafe fix
17 17 |         process()
18 18 |     except MyException as e:
19 19 |         logger.exception("process failed")
20    |-        raise e
   20 |+        raise
21 21 | 
22 22 | 
23 23 | def good():

TRY201.py:63:19: TRY201 [*] Use `raise` without specifying exception name
   |
61 |         logger.exception("process failed")
62 |         if True:
63 |             raise e
   |                   ^ TRY201
   |
   = help: Remove exception name

ℹ Unsafe fix
60 60 |     except MyException as e:
61 61 |         logger.exception("process failed")
62 62 |         if True:
63    |-            raise e
   63 |+            raise
64 64 | 
65 65 | 
66 66 | def bad_that_needs_recursion_2():

TRY201.py:74:23: TRY201 [*] Use `raise` without specifying exception name
   |
73 |             def foo():
74 |                 raise e
   |                       ^ TRY201
   |
   = help: Remove exception name

ℹ Unsafe fix
71 71 |         if True:
72 72 | 
73 73 |             def foo():
74    |-                raise e
   74 |+                raise


