question

Upvotes
Accepted
11 4 3 7

Elektron api exception need more info

This error message was on screen, not crash, my program continue to run, guess not crucial, but would someone give me more info behind that? thanks.

loggerMsg TimeStamp: 17:04:42.021 ClientName: Consumer_1_1 Severity: Error Text: EMA Exception Handler

Application: WorkHorse Process Id: 0xE30 Thread Id: 0x2328

File: ..\..\..\Src\Access\Impl\Thread.cpp Line: 43 Exception "C++ exception" (0xE06D7363) occured at 0x00007FFC919F8B9C

Stack Trace: 0x00007FFC919F8B9C C:\Windows\system32\KERNELBASE.dll: RaiseException() + 108 bytes 0x00000000620114F1 C:\Windows\SYSTEM32\MSVCR100.dll: CxxThrowException() + 129 bytes 0x00007FFC71D979CF e:\bin\prodtest\libema.dll: thomsonreuters::ema::access::OmmInvalidUsageException::getText() + 687 bytes 0x00007FFC71D4431B e:\bin\prodtest\libema.dll: thomsonreuters::ema::access::FieldEntry::getReal() + 443 bytes 0x00007FFC750EA5CA e:\bin\prodtest\SharedBase.dll: CElektronClient::UpdateInstData() + 186 bytes 0x00007FFC750EA960 e:\bin\prodtest\SharedBase.dll: CElektronClient::onUpdateMsg() + 240 bytes 0x00007FFC71D5EA51 e:\bin\prodtest\libema.dll: thomsonreuters::ema::access::GenericMsg::extendedHeader() + 44753 bytes 0x00007FFC71D5E749 e:\bin\prodtest\libema.dll: thomsonreuters::ema::access::GenericMsg::extendedHeader() + 43977 bytes 0x00007FFC846D7586 e:\bin\prodtest\librsslVA.dll: rsslReactorCloseChannel() + 3398 bytes 0x00007FFC846D7D70 e:\bin\prodtest\librsslVA.dll: rsslReactorCloseChannel() + 5424 bytes 0x00007FFC846D8846 e:\bin\prodtest\librsslVA.dll: rsslReactorCloseChannel() + 8198 bytes 0x00007FFC846E8D86 e:\bin\prodtest\librsslVA.dll: rsslTunnelStreamSubmitMsg() + 62726 bytes 0x00007FFC846DE1DB e:\bin\prodtest\librsslVA.dll: rsslTunnelStreamSubmitMsg() + 18779 bytes 0x00007FFC846DCF80 e:\bin\prodtest\librsslVA.dll: rsslTunnelStreamSubmitMsg() + 14080 bytes 0x00007FFC846D6646 e:\bin\prodtest\librsslVA.dll: rsslReactorSubmitMsg() + 3190 bytes 0x00007FFC846D8B0A e:\bin\prodtest\librsslVA.dll: rsslReactorCloseChannel() + 8906 bytes loggerMsgEnd

elektronrefinitiv-realtimeelektron-sdk
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
138 4 7 8

@James.Shen

From the top of stack-trace, it seems to be a problem when calling FieldEntry::getReal(). To get more information, you may need try/catch statement, it will print out more information of the actual problem. Below is the method AppClient::decode() that I call fe.getReal() for Integer field and it will raise an exception.

void AppClient::decode( const FieldList& fl )
{
	try{
		while ( fl.forth() )
		{
			const FieldEntry& fe = fl.getEntry();

			cout << "Fid: " << fe.getFieldId() << " Name: " << fe.getName() << " DataType: " << DataType( fe.getLoad().getDataType() ) << " Value: ";

			if ( fe.getCode() == Data::BlankEnum )
				cout << " blank" << endl;
			else
				switch ( fe.getLoadType() )
			{
				case DataType::FieldListEnum :
					cout << ",  contains FieldList." << endl;
					decode( fe.getFieldList() );
					break;
				case DataType::MapEnum :
					cout << ",  contains map." << endl;
					decode( fe.getMap() );
					break;
				case DataType::RefreshMsgEnum :
					cout << ",  contains refresh message." << endl;
					decode( fe.getRefreshMsg() );
					break;
				case DataType::UpdateMsgEnum :
					cout << ",  contains update message." << endl;
					decode( fe.getUpdateMsg() );
					break;
				case DataType::RealEnum :
					cout << fe.getReal().getAsDouble() << endl;
					break;
				case DataType::DateEnum :
					cout << (UInt64)fe.getDate().getDay() << " / " << (UInt64)fe.getDate().getMonth() << " / " << (UInt64)fe.getDate().getYear() << endl;
					break;
				case DataType::TimeEnum :
					cout << (UInt64)fe.getTime().getHour() << ":" << (UInt64)fe.getTime().getMinute() << ":" << (UInt64)fe.getTime().getSecond() << ":" << (UInt64)fe.getTime().getMillisecond() << endl;
					break;
				case DataType::IntEnum :
					// This will raise an exception
					// 	cout << fe.getInt() << endl;
					cout << fe.getReal() << endl;
					break;
				case DataType::UIntEnum :
					cout << fe.getUInt() << endl;
					break;
				case DataType::AsciiEnum :
					cout << fe.getAscii() << endl;
					break;
				case DataType::ErrorEnum :
					cout << fe.getError().getErrorCode() << "( " << fe.getError().getErrorCodeAsString() << " )" << endl;
					break;
				case DataType::EnumEnum :
					cout << fe.getEnum() << endl;
					break;
				default :
					cout << endl;
					break;
			}
		}
	}
	catch (OmmException & e)
	{
		cout << e << endl;
	}
}

From the above code, it produces the following output that contains more details of the exception. In this case, the problem is "Attempt to getReal() while actual entry data type is Int".

Hope this helps.


ema-exception.png (44.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11 4 3 7

I guess I forgot check blank before call getreal

if (fe.getCode() == Data::BlankEnum)

continue;

I didn’t see the error again after add this, thanks for help me.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea