question

Upvotes
Accepted
3 0 0 2

How to handle OmmInvalidUsageException: Attempt to real() while entry data is blank. (C#)

We are extract fields from Refinitiv real-time data like this:

foreach (var field in updateMsg.Payload().FieldList())
{
    switch (field.FieldId)
    {
        case 3:
            Sym = field.OmmRmtesValue().ToString();
            break;
        case 19:
            Open = field.OmmRealValue().AsDouble();
            break;
...
}

The problem is, we encounter the following error message from time to time:

Unhandled exception. Exception Type='OmmInvalidUsageException', Text='Attempt to real() while entry data is blank.', Error Code='-4048'

How can we handle it? I check member functions/variables of field of updateMsg.Payload(), seems there isnt something like "HasValue" for me to call?

#technologyema-apirefinitiv-realtime-sdk
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvote
Accepted
22.6k 59 14 21

Hello @vnaik01,

The application code should first check to see if the data is not-blank before it tries to decode its payload. The example 290 of the EMA C# SDK shows, how this can be implemented in the code:

if (Data.DataCode.BLANK != fieldEntry.Code)
  ...


icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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