Hi all,

I've been using libpqxx now for a bit more than a week and it looks
great.
There's one thing, though, that made me wonder. I want to isolate pqxx
specifics in my database access code inside a few "wrapper" classes.
This also means that no pqxx exception may escape. 
The problem I'm facing is that pqxx has four different top-level
exception classes (broken_connection, sql_error, in_double_error, and
internal_error). In order to not let any of those exceptions leak out,
I'll have to write a try/catch with 4 different catch blocks for each
call that may throw. This causes a lot of code duplication. 
Wouldn't it be a better idea to have one exception base class (e.g.
pqxx::base_exception) and derive the other pqxx exceptions from
base_exception, instead of deriving them form std::runtime_error and
std::logic_error?

Kind regards,

        Marcel Loose.

_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to