Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 382 Bytes

pointless-exception-statement.md

File metadata and controls

19 lines (12 loc) · 382 Bytes

Pattern: Unnecessary exception statement

Issue: -

Description

Used when an exception is created without being assigned, raised or returned for subsequent use elsewhere.

Example of incorrect code:

Exception("This exception is a statement.")  # [pointless-exception-statement]

Example of correct code:

raise Exception("This will raise.")