Boost logo

Geometry :

Subject: [ggl] Definition of exception types
From: Mateusz Loskot (mateusz)
Date: 2009-06-13 21:37:32


Hi,

I'd like to collect some thoughts and guidelines about exception types
defined in GGL.

Do we stick to Boost guidelines [1] ?

Should we have abstract ggl::exception defined as std::exception
subclass and derive all other exceptions from it?

I'd suggest to prefer to std:: naming with _error postfix, for instance
ggl::wkb::value_error, than what I have now:
ggl::value_wkb_exception
and others.

Among others, there seems to be two structures popular:

1. All GGL exceptions live directly in ggl:: and are defined in single
file, for instance:

ggl::wkb_value_error
ggl::wkb_read_error

2. Exceptions are categorized using namespace

ggl::wkb::value_error
ggl::wkb::read_error
ggl::wkb::write_error
ggl::wkt::write_error
...
ggl::algorithm::intersection_error
...

Which to prefer?

Any other insights?

[1] http://www.boost.org/community/error_handling.html

Cheers,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

Geometry list run by mateusz at loskot.net