Error handling in V3

I have a piece of code to fetch option data which I was using in fyers-apiv2 and have recently migrated to v3

in v2, I had error handling enabled for common errors

if data['s'] != 'ok':

if data.get('code') == None:

print(data)

elif data['code'] == -300:

print('Skip')

pass

elif data['code'] == -10:

print(data)

print('Skip')

pass

I don’t recall exactly what those error codes stand because the spreadsheet with explaination of error codes is no longer in the documentation. But I am sure that 1 of the error code was for missing data and 1 for non existing symbol

However in v3, this error handling did not prove to be useful. In this request, Fyers does not give error code at all.

Please provide any documentation/ error code list about how we can handle these errors

@algo_go please migrate to APIv3. they are not supporting APIv2.

This is v3. I am asking if they have any error code documentation like they did in v2

Hi @algo_go

Could you please elaborate on the API you’re trying to hit , the payload input given and the API response received to help us understand this better .

Hi @WWhYB2qrsx , attaching my query


        query = \

                {"symbol":"NSE:NIFTY23D1417650CE",

                "resolution":"1",

                "date_format":"1",

                "range_from":  "2023-10-21",

                "range_to": "2023-12-21",

                "cont_flag":"1"}

        data = fyers.history(query)

Hi @algo_go Those error codes are well known HTTP status code. Ref. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes