Files
openide/python/python-psi-impl/resources/inspectionDescriptions/PyExceptClausesOrderInspection.html
Louis Vignierandintellij-monorepo-bot 1869ec9da6 [codeInspection] Fix python inspection descriptions
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
2023-04-28 13:13:25 +00:00

27 lines
626 B
HTML

<html>
<body>
<p>Reports cases when <code>except</code> clauses are not in the proper order,
from the more specific to the more generic, or one exception class is caught twice. </p>
<p>
If you do not fix the order, some exceptions may not be caught by the most specific handler.
</p>
<p><b>Example:</b></p>
<pre><code>
try:
call()
except ValueError:
pass
except UnicodeError:
pass
</code></pre>
<p>The IDE recommends moving the clause up. When the quick-fix is applied, the code changes to:</p>
<pre><code>
try:
call()
except UnicodeError:
pass
except ValueError:
pass
</code></pre>
</body>
</html>