Boost logo

Boost :

From: davlet_panech (davlet_panech_at_[hidden])
Date: 2002-02-21 19:24:59


Is there any any interest in a runtime_error subclass constructible
from an errno value, such that the description returned by `what()'
is created using a call to strerror()? I think such class could be
useful for at least some of the existing boost libraries, such as
Boost.Threads, or the Socket library (which doesn't exist yet, but

class sys_error: public std::runtime_error {
  sys_error( const std::string &s ): runtime_error( s )

class specfic_sys_error: public sys_error

  // Pass strerror( errno ) to base class ctor
  // Pass strerror( errno_val ) to base ctor
  specific_sys_error( int errno_val );

  // Create error description "perror-style", i.e.,
  // details << ": " << strerror( errno );
  template< class T >
  specific_sys_error( const T &details, int errno )


// Possibly a few subclasses at least for some
// of the errno values (ENOENT & EACCESS are good
// candidates IMHO).


Boost list run by bdawes at, gregod at, cpdaniel at, john at