Skip to content

Function to check internet access before network calls#1672

Open
dikwickley wants to merge 1 commit intoweecology:mainfrom
dikwickley:handle-network-fail
Open

Function to check internet access before network calls#1672
dikwickley wants to merge 1 commit intoweecology:mainfrom
dikwickley:handle-network-fail

Conversation

@dikwickley
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retriever should gracefully fail if there is no internet.

1 participant