ioxx::system_error Class Reference

Base exception class for all operating system errors. More...

Inherits std::runtime_error.

List of all members.

Public Member Functions

 system_error (int ec, std::string const &context)
 Construct a system_error using an errno and a textual context description.

Public Attributes

int error_code
 The errno value returned by operating system.

Detailed Description

Base exception class for all operating system errors.

System errors are are caused by external conditions such as a network connection timing out, lack of resources, or some other OS-specific problem. The exact nature of the error is described by the standard errno code, respectively a human-readable string that can be obtained through the inherited method std::exception::what(). For example, the expression

system_error(ENOSPC, "writing to /tmp/test.data").what() 

would return:

writing to /tmp/test.data: No space left on device 

The textual descriptions are obtained from std::strerror().

See also:
throw_errno_if

Constructor & Destructor Documentation

ioxx::system_error::system_error ( int  ec,
std::string const &  context 
)

Construct a system_error using an errno and a textual context description.

The string used to describe the context will be prepended to the actual error message that can be retrieved with std::exception::what().

Parameters:
ec Native errno code that describes the error.
context Description of the system call context that failed.
Generated on Mon Mar 1 18:42:38 2010 for ioxx by  doxygen 1.6.3