[fdo-internals] Unwinding FDO exceptions

Mateusz Loskot mateusz at loskot.net
Sun Feb 4 17:19:03 EST 2007


Thank you Greg!

Mateusz

Greg Boone wrote:
> You results look accurate. FILO behaviour is as expected.
> 
>     -----Original Message-----
>     *From:* fdo-internals-bounces at lists.osgeo.org on behalf of Mateusz
>     Loskot
>     *Sent:* Sun 2/4/2007 2:34 AM
>     *To:* fdo-internals
>     *Cc:*
>     *Subject:* [fdo-internals] Unwinding FDO exceptions
> 
>     Hello,
> 
>     I'm not sure I understand how to process the roll of FDO exceptions,
>     so I'd like to ask for confirmation if I'm correct or not.
> 
>     Here are blocks of nested try-catch that mimic situation in which an
>     exception is thrown by a callee and re-thrown by a caller, and so on.
>     In the catch clause, is presented the idea of unwinding nested
>     exception, using some pseudo-code to make the example simpler.
> 
>     //------------------------------------
>     try
>     {
>       try
>       {
>         try
>         {
>           throw FdoException::Create(L"First exception");
>         }
>         catch (FdoException* ex)
>         {
>           throw FdoException::Create(L"Second caused by first", ex);
>         }
>       }
>       catch (FdoException* ex)
>       {
>           throw FdoException::Create(L"Third caused by second", ex);
>       }
>     }
>     catch (FdoException* ex)
>     {
>       // echo is a pseudo-code representing stdout action
>       echo "*** FDO FAILURE ***\n"
>       echo ex->GetExceptionMessage()
> 
>       FdoPtr<FdoException> cause(ex->GetCause());
>       while(NULL != cause)
>       {
>         echo "*** " + cause->GetExceptionMessage() + "\n"
> 
>         cause = cause->GetCause();
>       }
>       ex->Release();
>     }
>     //------------------------------------
> 
> 
>     And here is the output:
> 
>     *** FDO FAILURE ***
>       *** Third caused by second
>        *** Second caused by first
>         *** First exception
> 
> 
>     Is this output correct and as usually expected in FDO?
>     Is this correct to assume that exceptions are
>     queued as in FILO, First In - Last Out ?
> 
> 
>     Cheers
>     --
>     Mateusz Loskot
>     http://mateusz.loskot.net
>     _______________________________________________
>     fdo-internals mailing list
>     fdo-internals at lists.osgeo.org
>     http://lists.osgeo.org/mailman/listinfo/fdo-internals
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> fdo-internals mailing list
> fdo-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-internals


-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the fdo-internals mailing list