The ICLibErrorInfo class represents error information. When a C library call results in an error condition, objects of the ICLibErrorInfo class are created. The per thread global variable errno is used to obtain the error text.
The Open Class Library provides the ITHROWCLIBERROR macro for throwing exceptions constructed with ICLibErrorInfo information. This macro has the following parameters:
This macro generates code that calls throwCLibError, which does the following:
You can construct and destruct objects of this class. You cannot copy or assign objects of this class.
![]() |
public:
virtual ~ICLibErrorInfo()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
ICLibErrorInfo(const char* CLibFunctionName = 0)
You can only construct objects of this class using the default constructor.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to return the error information provided by objects of this class.
![]() |
public:
virtual unsigned long errorId() const
Returns the value of errno, which you can use to obtain the errno information.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isAvailable() const
If the error text is available, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual operator const char *() const
Returns the error text.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual const char* text() const
Returns the error text.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to support the throwing of exceptions.
![]() |
public:
static void throwCLibError( const char* functionName, const IExceptionLocation& location, IBaseErrorInfo::ExceptionType name = accessError, IException::Severity severity = IException::recoverable )
Creates an ICLibErrorInfo object and uses the text from it to do the following:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
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 )