blob: 8b7282c5c39f82c9de2a86d5083036998d3f8e94 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title>
Catching Java exceptions
</title>
</head>
<body>
<h1>
Catching Java exceptions
</h1>
<p>
It is possible to suspend the execution of thread when an exception is thrown by specifying an
exception breakpoint. Execution can be suspended at locations where the exception is
uncaught, caught, or both.
</p>
<ol>
<li>
Choose <strong>Add Java Exception Breakpoint</strong> from the
Breakpoints view or the workbench <strong>Run</strong> menu.&nbsp;&nbsp;
</li>
<li>
A dialog listing all of the available exceptions is shown.
</li>
<li>
Type the name of the exception you want to catch or select it from the list.
</li>
<li>
At the bottom of the page, use the checkboxes to specify how you want execution to suspend at locations where the exception is thrown.
<ul>
<li>
Select <strong>Caught</strong> if you want execution to suspend at locations where the exception
is thrown and caught by a <code>catch</code> clause.
</li>
<li>
Select <strong>Uncaught</strong> if you want execution to suspend at locations where the exception is uncaught.
</li>
</ul>
</li>
</ol>
<p>
<strong>Note:</strong> Exception breakpoints can be enabled and disabled and have hit counts
just like regular breakpoints.
</p>
<p>
<img border="0" src="../images/ngrelc.png" alt="Related concepts" ><br>
<a href="../concepts/concepts-1.htm">Java development tools (JDT)</a><br>
<a href="../concepts/cbrkpnts.htm">Breakpoints</a>
</p>
<p>
<img border="0" src="../images/ngrelt.png" alt="Related tasks" ><br>
<a href="../tasks/tasks-134.htm">Suspending threads</a><br>
<a href="../tasks/tasks-144.htm">Adding breakpoints</a><br>
<a href="../tasks/tasks-144a.htm">Removing breakpoints</a><br>
<a href="../tasks/tasks-144b.htm">Enabling and disabling breakpoints</a><br>
<a href="../tasks/tasks-145.htm">Setting method breakpoints</a><br>
</p>
<p>
<img border="0" src="../images/ngrelr.png" alt="Related reference" ><br>
<a href="../reference/views/breakpoints/ref-breakpoints_view.htm">Breakpoints view</a>
</p>
</body>
</html>