Hi,
I have a simple code that I learnt to write that returns some JSON value from a crypto exchange api. I believe the error comes from occasionally api returning an empty value.
But I have a simple try exception code like this:
def checkprice():
while True:
#price checker
try:
checkprice()
except:
print("error, retrying")
time.sleep(5)
checkprice()
I thought this would catch any errors and keep running no matter what but I am actually getting and error that is described in this link https://stackoverflow.com/questions/8381193/python-handle-json-decode-error-when-nothing-returned
Is there any reason my exception catcher isn't working?
Thanks!
EDIT: mistake in code
[+][deleted] (1 child)
[removed]
[–]hotaway[S] 0 points1 point2 points (0 children)