# Passenger::SystemException Class Reference
[Exceptions]

Represents an error returned by a system call or a standard library call. More...

`#include <Exceptions.h>`

Inheritance diagram for Passenger::SystemException:
[legend]

List of all members.

## Public Member Functions

| SystemException (const string &briefMessage, int errorCode)
| Create a new SystemException.
int | code () const throw ()
| The value of `errno` at the time the error occured.
string | brief () const throw ()
| Returns a brief version of the exception message.
string | sys () const throw ()
| Returns the system's error message.

## Detailed Description

Represents an error returned by a system call or a standard library call.

Use the code() method to find out the value of `errno` at the time the error occured.

## Constructor & Destructor Documentation

Passenger::SystemException::SystemException | ( | const string & | briefMessage,
|  | int | errorCode |
| ) |  |  | `[inline]`

Create a new SystemException.

Parameters:

  | briefMessage | A brief message describing the error.
  | errorCode | The error code, i.e. the value of errno right after the error occured.

Note:
  A system description of the error will be appended to the given message. For example, if `errorCode` is `EBADF`, and `briefMessage` is "Something happened", then what() will return "Something happened: Bad file descriptor (10)" (if 10 is the number for EBADF).

Postcondition:
  code() == errorCode
  brief() == briefMessage

## Member Function Documentation

string Passenger::SystemException::brief | ( |  | ) | const throw ()`[inline]`

Returns a brief version of the exception message.

This message does not include the system error description, and is equivalent to the value of the `message` parameter as passed to the constructor.

string Passenger::SystemException::sys | ( |  | ) | const throw ()`[inline]`

Returns the system's error message.

This message contains both the content of `strerror(errno)` and the errno number itself.

The documentation for this class was generated from the following file:

- Exceptions.h