== Why is this an issue? Creating a new ``++Exception++`` without actually raising it has no effect and is probably due to a mistake. === Noncompliant code example [source,python] ---- def func(x): if not isinstance(x, int): TypeError("Wrong type for parameter 'x'. func expects an integer") # Noncompliant if x < 0: ValueError # Noncompliant return x + 42 ---- === Compliant solution [source,python] ---- def func(x): if not isinstance(x, int): raise TypeError("Wrong type for parameter 'x'. func expects an integer") if x < 0: raise ValueError return x + 42 ---- == Resources * https://docs.python.org/3/tutorial/errors.html#raising-exceptions[Python documentation - Raising Exceptions] ifdef::env-github,rspecator-view[] ''' == Implementation Specification (visible only on this page) === Message Raise this exception or remove this useless statement === Highlighting Primary: The statement creating an Exception. endif::env-github,rspecator-view[]