Handling HTTP Request Errors When No Internet Connection is Available

I want to check for an internet connection using an HTTP request and perform actions based on the result. When the internet is available, the program works fine, entering the if block and continuing. However, when there is no internet, I get the following error: “Http client: No such host is known.”. When this error occurs, it doesn’t go to the else block or the catch part. What should I do to solve this issue?

Hi @Emirhan_ALICI

Try to set the “Continue On Error” property’s value to True.

regards.

@Emirhan_ALICI,

If you continue the execution it will go to Catch section. Also check if you have enabled Continue on Exception button in Studio.

To check if Internet is available you can use below query to identify in If else block.

System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable

The query will give True if Internet will be available or else False

Thank you so much , its correct solutions for my problem.

But now, when I run the program with an internet connection and the internet is disconnected afterward, it still returns that there is an internet connection. What should I do to fix this?

Even when I try to continue, it doesn’t proceed and keeps giving the same error, staying stuck in the same place. What should I do to fix this?

What you said works perfectly, thank you! At the same time, I’m also trying to learn the solution for the method I created because I need to use it in certain situations.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.