<!-- Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
<TITLE>Handling errors the smart way</TITLE>
</HEAD>
<BODY >
<CENTER>
<TABLE WIDTH=100%>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<A HREF="sld001.htm">First</A>
<A HREF="sld041.htm">Previous</A>
<A HREF="sld043.htm">Next</A>
<A HREF="sld093.htm">Last</A>
<A HREF="index.htm">Index</A>
<A HREF="dbi.perl.org">Home</A>
<A HREF="tsld042.htm">Text</A>
</TD> </TR>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<IMG SRC="img042.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
</TD> </TR>
</TABLE>
<P>Slide 42 of 93</P>
</CENTER>
<!-- <UL>
<H2>Handling errors the smart way</H2>
</UL></P>
<P><UL>
<LI><H2>Life after death:
</H2>
<UL>
$h->{RaiseError} = 1;
<BR><BR>eval {
<BR> foo();
<BR> $h->method; # if it fails then the DBI calls die
<BR> bar($h); # may also call DBI methods
<BR>};
<BR>if ($@) { # $@ holds error message
<BR> ... handle the error here
<BR>}
<UL>
<BR></UL></UL></UL><UL>
<LI><H2>Bonus prize:
</H2>
<UL>
<LI>Other, non-DBI, code within the eval block may also raise an exception that will be caught and can be handled cleanly
</UL></UL><UL>
<H2>.</H2>
</UL></P>
<P> -->
</Body>
</HTML>