question

Upvotes
Accepted
36 6 8 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
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.

@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.

Upvotes
Accepted
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.

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.

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

Upvotes
46 4 5 10

@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.

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
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)
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
46 4 5 10

@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


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