FW: [fdo-dev] Standard exceptions handling practice

Mateusz Loskot mateusz at loskot.net
Fri Sep 1 21:00:07 EDT 2006


Greg Boone wrote:
> [...]
> Here is a simple example of catching an exception and adding a new error
> message to the FdoException pyramid....
> 
> e.g.  
> 
> try 
> {
> 	Foo();
> } 
> catch (FdoException* cause) 
> {
>     // Failed foo(). Create a new nested exception
>     // taking the caught exception as the cause
>     throw FdoException::Create(
> 	NlsMsgGet(ABC_76_FAIL_FOO, "Failed executing Foo()."), cause);
> }

This is a very good guideline. Thanks.
I think it should be added to the dev guide.

Is this 'pyramid of messages' related to this
guideline from dev guide?

(Page 27)
"In some cases, underneath an FDO command, the GIS level throws a
GisException. The FDO command then traps the GisException and wraps it
in an FdoCommandException (or FdoSchemaException for a schema
command). In this case, several messages are returned by one exception."

AFAI understand, Robert's guideline is about exception
message construction and the one from dev guide is about
processing pyramid of messages.

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




More information about the Fdo-internals mailing list