Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/KotlinCatchMayIgnoreException.html
Nikita Bobko 8b91f1c7c0 Kotlin plugin inspection descriptions: 'A quick-fix' -> 'The quick-fix'
Review: https://jetbrains.team/p/ij/reviews/98339

It's a concrete quick-fix

GitOrigin-RevId: 3388021f0cde4cb49f8c447361c0d8b2fd08cafd
2022-12-01 13:43:09 +00:00

32 lines
882 B
HTML

<html>
<body>
Reports <code>catch</code> blocks that are empty or may ignore an exception.
<p>While occasionally intended, empty <code>catch</code> blocks may complicate debugging.
Also, ignoring a <code>catch</code> parameter might be wrong.</p>
<p>
The inspection won't report any <code>catch</code> parameters named <code>ignore</code>, <code>ignored</code>, or <code>_</code>.
</p>
<p>
You can use the quick-fix to change the exception name to <code>_</code>.
</p>
<p><b>Example:</b></p>
<pre><code>
try {
throwingMethod()
} catch (ex: IOException) {
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
try {
throwingMethod()
} catch (_: IOException) {
}
</code></pre>
<!-- tooltip end -->
Use the <b>Do not warn when 'catch' block contains a comment</b> option to ignore <code>catch</code> blocks with comments.
</body>
</html>