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 ?


Best Answer

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

Answers

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

  • 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

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

  • @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)

    image

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

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

    image

    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