List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:July 5 2005 11:07am
Subject:Re: exception hierarchy
View as plain text  
Chris Frey wrote:
> 
> This would introduce
> multiple inheritance into the exception hierarchy if we wanted to
> keep a common mysqlpp::Exception base class, 

The only purpose for that class is to allow someone to catch all MySQL++ 
exceptions in a single catch block.  In documenting this change, I've 
also been conflating the advantages from deriving from std::exception, 
which provides a consistent interface to all exceptions.  So while you 
don't lose out on the latter with your proposal, you do make it more 
difficult to separate the MySQL++ exceptions from C++ library exceptions.

This isn't a small concern.  I know you know that MySQL++ can trigger 
library exceptions, such as through vector::at().  One problem I have 
with these exceptions is that -- at least with current Linux standard 
C++ libraries -- the what() method just returns the name of the class 
that threw it.  MySQL++ exceptions have much more useful what()'s, which 
can be sent directly to error logs and such.  Therefore, it's likely 
that real programs will treat these types of exceptions differently.

Now, if you wanted to argue in favor of adding another layer just under 
Exception, parallel to the division in the Standard Library, I could be 
persuaded...
Thread
exception hierarchyChris Frey4 Jul
  • Re: exception hierarchyWarren Young5 Jul
    • Re: exception hierarchyChris Frey5 Jul
      • Re: exception hierarchyWarren Young6 Jul