mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
24 lines
1.1 KiB
HTML
24 lines
1.1 KiB
HTML
<html>
|
|
<body>
|
|
Reports exceptions that are thrown from inside <code>catch</code> blocks but do not "wrap" the caught exception.
|
|
<p>When an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,
|
|
such as stack frames and line numbers.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
...
|
|
catch (IOException e) {
|
|
closeAllConnections();
|
|
throw new ConnectException("Connection problem."); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Configure the inspection:</p>
|
|
<ul>
|
|
<li>Use the <b>Ignore if result of exception method call is used</b> option to indicate whether the inspection should ignore exceptions whose
|
|
argument is the result of a method
|
|
call on the original exception, such as <code>getMessage()</code>.</li>
|
|
<li>Use the <b>Ignore if thrown exception cannot wrap an exception</b> option to ignore <code>throw</code> statements that throw exceptions without a
|
|
constructor that accepts a <code>Throwable</code> cause.</li>
|
|
</ul>
|
|
</body>
|
|
</html> |