Pattern: Use of invalid type when raising exception
Issue: -
A raise
statement must raise a valid exception type, otherwise Python raises a TypeError
at runtime.
Example of incorrect code:
def bad_case():
raise 1 # [raising-bad-type]
Example of correct code:
def good_case():
raise ValidException('error details')