| Home | Libraries | People | FAQ | More

# boost::asio::system_exception Class Reference

Inherits std::exception.

Inheritance diagram for boost::asio::system_exception:

List of all members.

## Detailed Description

The system_exception class is used to represent system conditions that prevent the library from operating correctly.

## Public Member Functions

| system_exception (const std::string &context, int code)
| Construct with a specific context and error code.
| system_exception (const system_exception &e)
| Copy constructor.
virtual | ~system_exception () throw ()
| Destructor.
system_exception & | operator= (const system_exception &e)
| Assignment operator.
virtual const char * | what () const throw ()
| Get a string representation of the exception.
const std::string & | context () const
| Get the implementation-defined context associated with the exception.
int | code () const
| Get the implementation-defined code associated with the exception.

## Related Functions

(Note that these are not member functions.)
template<typename Ostream>
Ostream & | operator<< (Ostream &os, const system_exception &e)
| Output the string associated with a system exception.

## Constructor & Destructor Documentation

boost::asio::system_exception::system_exception | ( | const std::string & | context,
|  | int | code |
| ) |  |  |

Construct with a specific context and error code.

boost::asio::system_exception::system_exception | ( | const system_exception & | e | ) |

Copy constructor.

virtual boost::asio::system_exception::~system_exception | ( |  | ) | throw ()`[virtual]`

Destructor.

## Member Function Documentation

system_exception& boost::asio::system_exception::operator= | ( | const system_exception & | e | ) |

Assignment operator.

virtual const char* boost::asio::system_exception::what | ( |  | ) | const throw ()`[virtual]`

Get a string representation of the exception.

const std::string& boost::asio::system_exception::context | ( |  | ) | const

Get the implementation-defined context associated with the exception.

int boost::asio::system_exception::code | ( |  | ) | const

Get the implementation-defined code associated with the exception.

## Friends And Related Function Documentation

template<typename Ostream>

Ostream & operator<< | ( | Ostream & | os,
|  | const system_exception & | e |
| ) |  |  | `[related]`

Output the string associated with a system exception.

Used to output a human-readable string that is associated with a system exception.

Parameters:

  | os | The output stream to which the string will be written.
  | e | The exception to be written.

Returns:
  The output stream.

| Copyright © 2003 - 2006 Christopher M. Kohlhoff