---
source: crates/ruff_linter/src/rules/tryceratops/mod.rs
---
TRY301.py:14:13: TRY301 Abstract `raise` to an inner function
   |
12 |         a = process()
13 |         if not a:
14 |             raise MyException(a)
   |             ^^^^^^^^^^^^^^^^^^^^ TRY301
15 |
16 |         raise MyException(a)
   |

TRY301.py:16:9: TRY301 Abstract `raise` to an inner function
   |
14 |             raise MyException(a)
15 |
16 |         raise MyException(a)
   |         ^^^^^^^^^^^^^^^^^^^^ TRY301
17 |
18 |         try:
   |

TRY301.py:21:17: TRY301 Abstract `raise` to an inner function
   |
19 |             b = process()
20 |             if not b:
21 |                 raise MyException(b)
   |                 ^^^^^^^^^^^^^^^^^^^^ TRY301
22 |         except Exception:
23 |             logger.exception("something failed")
   |

TRY301.py:32:13: TRY301 Abstract `raise` to an inner function
   |
30 |         a = process()
31 |         if not a:
32 |             raise MyException(a)
   |             ^^^^^^^^^^^^^^^^^^^^ TRY301
33 |
34 |         raise MyException(a)
   |

TRY301.py:34:9: TRY301 Abstract `raise` to an inner function
   |
32 |             raise MyException(a)
33 |
34 |         raise MyException(a)
   |         ^^^^^^^^^^^^^^^^^^^^ TRY301
35 |
36 |         try:
   |

TRY301.py:39:17: TRY301 Abstract `raise` to an inner function
   |
37 |             b = process()
38 |             if not b:
39 |                 raise MyException(b)
   |                 ^^^^^^^^^^^^^^^^^^^^ TRY301
40 |         except* Exception:
41 |             logger.exception("something failed")
   |
