### ISystemErrorInfo

  The ISystemErrorInfo class represents error information that you can include in an exception object. When an operating system call results in an error condition, objects of the ISystemErrorInfo class are created. You can use the error text to construct a derived class object of IException.

  The Open Class Library provides the ITHROWSYSTEMERROR macro for throwing exceptions constructed with the following ISystemErrorInfo information:

  - The error ID returned from the system function
  - The name of the system function that returned an error code
  - One of the values of the enumeration IBaseErrorInfo::ExceptionType, which specifies the type of exception this macro creates
  - One of the values of the enumeration IException::Severity, which specifies the severity of the exception

  This macro generates code that calls throwSystemError, which does the following:

  1. Creates an ISystemErrorInfo object
  2. Uses the object to create an IException object
  3. Adds the operatingSystem error group to the object
  4. Adds location information
  5. Logs the exception data
  6. Throws the exception

#### AIX Considerations

  You can create objects of this class on AIX, but the objects contain no useful information and only have the default message: "System exception condition detected."

### ISystemErrorInfo - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class. You cannot copy or assign objects of this class.

~ISystemErrorInfo

      public:
      virtual ~ISystemErrorInfo()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

ISystemErrorInfo

      public:
      ISystemErrorInfo( unsigned long systemErrorId,
                        const char* systemFunctionName = 0 )

  You can only construct objects of this class using the default constructor.
  Note: If the constructor cannot load the error text, the Open Class Library provides the following default text: "No error text is available."

  systemErrorId
    The error ID identifying an operating system error.
  systemFunctionName
    The name of the failing system call that returned the error ID. If you specify systemFunctionName, the constructor prefixes it to the error text. Optional.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Error Information

Use these members to return error information provided by objects of this class.

errorId

      public:
      virtual unsigned long errorId() const

  Returns the error ID.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isAvailable

      public:
      virtual bool isAvailable() const

  If the error information is available, true is returned.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator const char *

      public:
      virtual operator const char *() const

  Returns the error text.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

text

      public:
      virtual const char* text() const

  Returns the error text.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Throw Support

Use these members to support the throwing of exceptions.

throwSystemError

      public:
      static void
        throwSystemError( unsigned long systemErrorId,
                          const char* functionName,
                          const IExceptionLocation& location,
                          IBaseErrorInfo::ExceptionType name = accessError,
                          IException::Severity severity = IException::recoverable )

  Used by the ITHROWSYSTEMERROR macro, this function creates an ISystemErrorInfo object and uses the text from it to do the following:

  1. Create an exception object
  2. Add the location information to it
  3. Log the exception data
  4. Throw the exception
  systemErrorId
    The error ID from the system.
  functionName
    The name of the function where the exception occurred.
  location
    An IExceptionLocation object containing the following:
    - Function name
    - File name
    - Line number where the function is called
  name
    Use the enumeration IBaseErrorInfo::ExceptionType to specify the type of the exception. The default is accessError.
  severity
    Use the enumeration IException::Severity to specify the severity of the error. The default is recoverable.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### ISystemErrorInfo - Inherited Member Functions and Data

#### Inherited Public Functions

  IBaseErrorInfo

  -     virtual ~IBaseErrorInfo()

  -     virtual unsigned long errorId() const = 0

  -     IBaseErrorInfo()

  -     virtual bool isAvailable() const = 0

  -     virtual operator const char *() const = 0

  -     virtual const char* text() const = 0

  -     void
          throwError( const IExceptionLocation& location,
                      ExceptionType name = accessError,
                      IException::Severity severity = IException::recoverable,
                      IException::ErrorCodeGroup errorGroup = IException::baseLibrary )

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None