question

yajnasteju avatar image
36 7 10 22

Exception while subscribing for news

I am writing a consumer application for reading news from EMA , i am getting a below exception

loggerMsg
TimeStamp: 13:31:51.825
ClientName: ChannelCallbackClient
Severity: Success
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_1
Connected component version: ads2.6.11.L1.linux.tis.rrg 64-bit
loggerMsgEnd

loggerMsg
TimeStamp: 13:31:53.712
ClientName: Consumer_1_1
Severity: Error
Text: EMA Exception Handler

Application: EMA Application
Process Id: 0xF51

File: Access/Impl/Thread.cpp
Line: 71
Exception occured
loggerMsgEnd

I am not able to find the cause of this , any help ?


elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apinewsexception
1 comment
10 |1500

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

@yajnasteju

Try adding a big try/catch in side the callback function and see if it catch the exception.

The log suggests that the exception was thrown in EMA dispatching thread. This could means the exception was thrown in callback function.

warat.boonyanit avatar image
4.4k 10 6 9

@yajnasteju

You should try adding a try/catch in side the callback function (onRefresh, onUpdate, etc.) and see if it catch the exception.

The log suggests that the exception was thrown in EMA dispatching thread. This could means the exception was thrown in callback function.

1 comment
10 |1500

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

Exactly I already did this - thank you ,

but the problem was while decoding NTA Fragments in MRN News .

There is a excception when the fragment size is 0 .

Im trying to debug this

iscas.wang avatar image
48 4 6 15

@Warat B. Hi, I encountered the same problem and now added try/catch in the callback function body.

One more question, is there anyway application can detect some core thread in ema sdk still alive ? If accidental events that try/catch still not works occur cause these core threads crash but my other threads still live, I expect to catch such message to take my own action, for example try to exit the whole application to make it reboot and register rics again ? Many thanks, expecting your reply.

10 |1500

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

moragodkrit.chumsri_1 avatar image
7.6k 15 6 9

@wangfugen

It looks like you want to catch unhandled exception yourself, correct?

There is a parameter named "CatchUnhandledException" you can set in the Ema Configuration file. If you set it to 0 (default is 1) the EMA passes unhandled exceptions to the operating system. In this case, I think the application layer can catch such an error to take your own action.

Please find the details of the parameter from Ema CPP Configuration Guide (EMACPP_ConfigGuide.pdf) section 3.1.4 (based on ESDK1.3.0.L1 package)


parameters.jpg (69.7 KiB)
10 |1500

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

iscas.wang avatar image
48 4 6 15

@moragodkrit Thanks for your replay. According to your advice,

First I should modify EmaConfig.xml to add two following consumer entries, right?

Second, if ema passes unhandled exception to the operation sysstem, How can I catch it or just let the operating system handle it , maybe crash my application?

If I try in my main() function like this:

int main(){
    try{
        AppClient client; 
        // put all register RIC code here
    } catch(const emaaccess::OmmException& excp)
    {
        // Will UnhandledException runs here ?
    }
}

Can my application catch the exception via OmmException ? Thanks


10 |1500

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