weecology / retriever

Quickly download, clean up, and install public datasets into a database management system
http://data-retriever.org
Other
306 stars 134 forks source link

Function to check internet access before network calls #1672

Open dikwickley opened 11 months ago

dikwickley commented 11 months ago

This PR fixes: #1660 As the other PR for this issue has been stale for quite some time, this one attempts to handle the network availablity issue.

There is a utility function that terminates the program in case there is a network failure. The function check_network() has to be called at the top of all functions that are making a network call.

In case there is a network failure, it will give this response:

image

Originally if there was a network failure it would throw an error.

@henrykironde If this approach looks good enough, I can proceed with adding this function everywhere.