blob: 12670a5fed40bace63dfa11e254b543a101e238a [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<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 Run menu.&nbsp;&nbsp;
</li>
<li>
A dialog listing all of the available exceptions is shown.
</li>
<li>
Either 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 check boxes 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 but caught.
</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.gif" alt="Related concepts" width="159" height="27"><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.gif" alt="Related tasks" width="159" height="27"><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.gif" alt="Related reference" width="159" height="27"><br>
<a href="../reference/ref-35.htm">Breakpoints view</a>
</p>
<p>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0" width="324" height=
"14"></a>
</p>
</body>
</html>