EMA C++ Developers Guide : 3 OMM Containers and Messages : 3.2 Classes : 3.2.5 OmmError Class
 
3.2.5 OmmError Class
The OmmError class is a special purpose class. It is a read only class implemented in the Enterprise Message API to notify applications about errors detected while processing received data. This class enables applications to learn what error condition was detected. Additionally it provides the getAsHex() method to obtain binary data associated with the detected error condition. The sole purpose of this class is to aid in debugging efforts.
The following code snippet presents usage of the OmmError class while processing ElementList.
 
 
void decode( const ElementList& elementList )
{
while ( elementList.forth() )
{
const ElementEntry& elementEntry = elementList.getEntry();
 
if ( elementEntry.getCode() == Data::BlankEnum )
continue;
else
switch ( elementEntry.getLoadType() )
{
case DataType::RealEnum:
cout << elementEntry.getReal().getAsDouble() << endl;
break;
case DataType::ErrorEnum:
cout << elementEntry.getError().getErrorCode() << "( " <<
elementEntry.getError().getErrorCodeAsString() << " )" << endl;
break;
}
}
}