<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6618.4">
<TITLE>[fdo-internals] Unwinding FDO exceptions</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV>You results look accurate. FILO behaviour is as expected.</DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Original Message----- <BR><B>From:</B>
fdo-internals-bounces@lists.osgeo.org on behalf of Mateusz Loskot
<BR><B>Sent:</B> Sun 2/4/2007 2:34 AM <BR><B>To:</B> fdo-internals
<BR><B>Cc:</B> <BR><B>Subject:</B> [fdo-internals] Unwinding FDO
exceptions<BR><BR></FONT></DIV>
<P><FONT size=2>Hello,<BR><BR>I'm not sure I understand how to process the
roll of FDO exceptions,<BR>so I'd like to ask for confirmation if I'm correct
or not.<BR><BR>Here are blocks of nested try-catch that mimic situation in
which an<BR>exception is thrown by a callee and re-thrown by a caller, and so
on.<BR>In the catch clause, is presented the idea of unwinding
nested<BR>exception, using some pseudo-code to make the example
simpler.<BR><BR>//------------------------------------<BR>try<BR>{<BR>
try<BR> {<BR> try<BR>
{<BR> throw FdoException::Create(L"First
exception");<BR> }<BR> catch
(FdoException* ex)<BR> {<BR>
throw FdoException::Create(L"Second caused by first",
ex);<BR> }<BR> }<BR> catch (FdoException*
ex)<BR> {<BR> throw
FdoException::Create(L"Third caused by second", ex);<BR> }<BR>}<BR>catch
(FdoException* ex)<BR>{<BR> // echo is a pseudo-code representing stdout
action<BR> echo "*** FDO FAILURE ***\n"<BR> echo
ex->GetExceptionMessage()<BR><BR> FdoPtr<FdoException>
cause(ex->GetCause());<BR> while(NULL != cause)<BR>
{<BR> echo "*** " + cause->GetExceptionMessage() +
"\n"<BR><BR> cause = cause->GetCause();<BR>
}<BR>
ex->Release();<BR>}<BR>//------------------------------------<BR><BR><BR>And
here is the output:<BR><BR>*** FDO FAILURE ***<BR> *** Third caused by
second<BR> *** Second caused by first<BR> ***
First exception<BR><BR><BR>Is this output correct and as usually expected in
FDO?<BR>Is this correct to assume that exceptions are<BR>queued as in FILO,
First In - Last Out ?<BR><BR><BR>Cheers<BR>--<BR>Mateusz Loskot<BR><A
href="http://mateusz.loskot.net">http://mateusz.loskot.net</A><BR>_______________________________________________<BR>fdo-internals
mailing list<BR>fdo-internals@lists.osgeo.org<BR><A
href="http://lists.osgeo.org/mailman/listinfo/fdo-internals">http://lists.osgeo.org/mailman/listinfo/fdo-internals</A><BR></FONT></P></BLOCKQUOTE>
</BODY>
</HTML>