question

Upvotes
Accepted
646 14 22 29

RSearchLib::IRSearchResponse Status codes

Hello,

I use COM API RSearch objects to get the tickers.

On RSearchQuery update I receive an object of RSearchLib::IRSearchResponse * pIRSearchResponse.

Then I do

l_hr = pIRSearchResponse->get_Status(&l_RSearchQueryStatus);

When everything is fine I get S_OK.

But I get 0x80040223 when there is no results for given search criteria. This is actually not an error, so I need to differentiate it from other errors.

Is there a list of possible status codes/errors?

eikoneikon-com-apistatus
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.

Upvotes
Accepted
39.3k 76 11 27

OK, now I see what you're looking for. Here's another example of the status you may receive: pIRSearchResponse.Status==0x8004021B, pIRSearchResponse.StatusDescription=="Invalid request response".
I'm afraid I don't have an exhaustive list of status codes and messages the library may produce. It's not documented anywhere, so to compile the list would require opening the source code. However, I believe that anything other than 0x80040223 is an error.
If you really need it, we could open the source code and get the exhaustive list.

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.

@Alex Putkov.

This is good enough for now.

Thank you.

Upvotes
39.3k 76 11 27

I'm not sure I understand what you need to differentiate. An error in search criteria names, e.g. unsupported value for AssetClass property or incorrect criteria name in SearchCriteria property will result in object raising an exception when you execute Send method.
This is quite distinct from no results returned into OnUpdate event (also signified by pIRSearchResponse.Status being equal to 0x80040223 and pIRSearchResponse.StatusDescription saying "No results were found matching your criteria").
If your intention is to differentiate between various reasons why there may be no results matching your criteria, such as spelling errors in criteria values vs. no results matching some numeric criteria, there's no way to do this. The search service does not know what values you intended to provide, it only knows the values you have provided. It has no way of determining if the criteria value is unintentionally misspelled or intentionally set to the value that has no matches.

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.

@Alex Putkov.

Basically, I just wanted to know what other statuses can be returned.

When it's "No results", then it's fine, I consider the request is complete.

If there is something like "I died in the middle of the communication with TR servers...", then I want to re-run the request again.