Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling connection error issue #1660 #1663

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions retriever/lib/socrata.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def socrata_autocomplete_search(dataset):
for i in range(len(datasets["results"])):
names.append(datasets["results"][i]["title"])

except HTTPError as e:
print("HTTPError :", e)
except (HTTPError,requests.exceptions.ConnectionError) as e:
print("Error Occured :", e)
return None

return names
Expand Down Expand Up @@ -77,8 +77,8 @@ def socrata_dataset_info(dataset_name):
"link": result[i]["link"]
})

except HTTPError as e:
print("HTTPError : ", e)
except (HTTPError,requests.exceptions.ConnectionError) as e:
print("Error Occured :", e)
return None

return resources
Expand Down Expand Up @@ -129,8 +129,8 @@ def find_socrata_dataset_by_id(dataset_id):
print("No socrata dataset exists for the id : {dataset_id}".format(
dataset_id=dataset_id))

except HTTPError as e:
print("HTTPError : ", e)
except (HTTPError,requests.exceptions.ConnectionError) as e:
print("Error Occured :", e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space (HTTPError,requests.exception (HTTPError, requests.exception

print("Error Occured :", e)
print("Error Occured : ", e) # Add a space after : 

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henrykironde I have made the corrections. Please check it. Is there anything else I should consider?

return {}

return resource
Expand Down