Contains detailed information about error. More...
Contains detailed information about error.
Most of openDAQ's methods in interfaces return ErrCode
. This is just an integer number. With IErrorInfo
interface it is possible to attach an error message and a source to the last error. The Interface function that returns an error can create an object that implements this interface and attaches it to thread-local storage using daqSetErrorInfo
function. The Client can check the return value of an arbitrary interface function and in case of an error, it can check if IErrorInfo
is stored in thread-local storage using daqGetErrorInfo
for additional error information.
makeErrorInfo
automatically creates IErrorInfo and calls daqSetErrorInfo
. In case of an error, checkErrorInfo
calls daqGetErrorInfo
to get extended error information and throws an exception.
Example:
Public Member Functions | |
virtual ErrCode INTERFACE_FUNC | setMessage (IString *message)=0 |
Sets the message of the error. More... | |
virtual ErrCode INTERFACE_FUNC | getMessage (IString **message)=0 |
Gets the message of the error. More... | |
virtual ErrCode INTERFACE_FUNC | setSource (IString *source)=0 |
Sets the source of the error. More... | |
virtual ErrCode INTERFACE_FUNC | getSource (IString **source)=0 |
Gets the source of the error. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | borrowInterface (const IntfID &intfID, void **obj) const =0 |
Returns another interface which is supported by the object without incrementing the reference count. More... | |
virtual ErrCode INTERFACE_FUNC | dispose ()=0 |
Disposes all references held by the object. More... | |
virtual ErrCode INTERFACE_FUNC | getHashCode (SizeT *hashCode)=0 |
Returns hash code of the object. More... | |
virtual ErrCode INTERFACE_FUNC | equals (IBaseObject *other, Bool *equal) const =0 |
Compares object to another object for equality. More... | |
virtual ErrCode INTERFACE_FUNC | toString (CharPtr *str)=0 |
Returns a string representation of the object. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | queryInterface (const IntfID &intfID, void **obj)=0 |
Returns another interface which is supported by the object and increments the reference count. More... | |
virtual int INTERFACE_FUNC | addRef ()=0 |
Increments the reference count for an interface on an object. More... | |
virtual int INTERFACE_FUNC | releaseRef ()=0 |
Decrements the reference count for an interface on an object. More... | |
Gets the message of the error.
message | Error description. |
Gets the source of the error.
source | Error source. |
Sets the message of the error.
message | Error description. |