Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-10-29 16:00:06


At 03:22 PM 10/27/2003, Jessie Hernandez wrote:
>...
>Well, I personally prefer a "large" socket exception hierarchy. This
makes
>it very easy to catch specific exceptions and provides better error
>messages. With the current STL file classes, you may get errors such as
>"ios_base::failbit set!" (since there is only one exception class,
>ios_base::failure). This doesn't tell me why the failure happened (does
the
>user have permissions to the file, etc.?) I'd rather have classes such as
>socket_base::connection_refused, etc., which have their what() methods
>overloaded to print out more specific messages.

FWIW, the LWG just looked at a similar situation for regular expressions.
The solution they prefer is for a single exception class for the library,
but adding a member function which will return a code which identifies the
specific reason for the failure. This member function is in addition to
what().

Also FWIW, a Sockets library was again mentioned in a presentation last
night by Bjarne Stroustrup as one of the standard library additions he
would really like to see.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk