Boost logo

Geometry :

Subject: [ggl] Definition of exception types
From: Mateusz Loskot (mateusz)
Date: 2009-06-14 21:07:04

Hartmut Kaiser wrote:
> One possibility is to extend the system error mechanism to ggl, very similar
> to what asio is doing. This is fairly easy as it involves just two or three
> type definitions and a couple of functions. This ggl::error_type type could
> be used as the function parameter type above and additionally could be
> embedded into the ggl::exceptions, making error handling consistent.
> Something along the following lines (that's from the top of my head,
> though):
> [...]
> This allows to use ggl::error_code as the type carrying the actual error
> description (making it usable as the parameter for the functions), while
> ggl::exception gets thrown, but holds an ggl::error_code internally.
> Additionally, as boost::system has been adopted by the C++0x standard, this
> integrates well with future library behavior.

I want to admit the solution you've explained it very interesting
and has potential to make errors handling consistent across
not-a-small library as is GGL. I like it.
The fact it's based on upcoming standard elements is a strong plus.

However, as it introduces significant changes and would require to
update many places in the library, I'm not the right person to discuss
and decide on further applicability of this solution.
So, I would leave this aspect of the discussion to Barend and Bruno.

Thanks Hartmut for a nice inspiration!


Mateusz Loskot,
Charter Member of OSGeo,

Geometry list run by mateusz at