Within my django project I am making a call out to a pull in some data.
I have organized the code below so that if the get request fails, it is ignored and the rest of the function continues (please no lectures on if this is bad practice or not).
job_results=[]
try:
resp = requests.get(mongo_job_results)
for item in resp.json():
job_results.append(item)
except ConnectionError:
pass
I still get the following error:
Exception Type: ConnectionError
Exception Value:
('Connection aborted.', OSError(99, 'Cannot assign requested address'))
What am I missing here?