<!-- Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
<TITLE>Custom Error Handling</TITLE>
</HEAD>
<BODY >
<CENTER>
<TABLE WIDTH=100%>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<A HREF="sld001.htm">First</A>
<A HREF="sld044.htm">Previous</A>
<A HREF="sld046.htm">Next</A>
<A HREF="sld096.htm">Last</A>
<A HREF="index.htm">Index</A>
<A HREF="dbi.perl.org">Home</A>
<A HREF="tsld045.htm">Text</A>
</TD> </TR>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<IMG SRC="img045.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
</TD> </TR>
</TABLE>
<P>Slide 45 of 96</P>
</CENTER>
<!-- <UL>
<H2>Custom Error Handling</H2>
</UL></P>
<P><UL>
<LI><H2>Dont want to just Print or Raise an Error?
</H2>
<UL>
<LI>Now you can Handle it as well
<UL>
$h->{HandleError} = sub {
};
<BR><BR>
</UL></UL></UL><UL>
<LI><H2>The HandleError code
</H2>
<UL>
<LI>is called just before PrintError/RaiseError are handled
<LI>its passed
<UL>
<LI>the error message string that RaiseError/PrintError would use
<LI>the DBI handle being used
<LI>the first value being returned by the method that failed (typically undef)
</UL><LI>if it returns false then RaiseError/PrintError are checked and acted upon as normal
</UL></UL><UL>
<LI><H2>
</H2>
</UL><UL>
<LI><H2>The handler code can
</H2>
<UL>
<LI>alter the error message text by changing $_[0]
<LI>use caller() or Carp::confess() or similar to get a stack trace
<LI>use Exception or a similar module to throw a formal exception object</UL></UL></P>
<P> -->
</Body>
</HTML>