[fdo-internals] Logging on exceptions

Traian Stanev traian.stanev at autodesk.com
Wed Apr 25 10:49:20 EDT 2007

Not sure if the example is out of context, but why do you catch an
FdoException only to rethrow it as another? That only hides the real
source of the error. Is it just for the logging?


-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org
[mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Mateusz
Sent: Tuesday, April 24, 2007 6:44 PM
To: fdo-internals
Subject: [fdo-internals] Logging on exceptions


While I'm testing the fdopostgis provider I use heavy logging, so in
many places my code looks as follows:

catch (FdoException* e)

   throw FdoCommandException::Create(...);

Honestly, I don't like when developer's tool is very explicit and
intrusive, what makes code less readable.

I'm thinking about creating my own sub-tree of exception types in which
I could automatically log a message/state in Create() operation of an

Do you think it's a good idea that I derive my own exceptions from FDO
types and instrument it with some utilities internally?

The logging is controlled in compilation time, similarly as assertions,
so I can turn it off any time when building.

Mateusz Loskot
fdo-internals mailing list
fdo-internals at lists.osgeo.org

More information about the fdo-internals mailing list