I have some code that is generating the following response:
The request failed: Google returned a response with code 429.
I can't get any of these if statements to trigger even though I'm printing the err variable so I know exactly what it says. What am I doing wrong here?
try:
<---irrelevant code--->
except (ResponseError, RuntimeError, TypeError, NameError, KeyError) as err:
print("Key error: {}. {}, while querying {} pausing".format(KeyError, err, stock))
if err == 429:
print("429 error")
<---more actions--->
if err == "The request failed: Google returned a response with code 429."
print("429 error")
<---more actions--->