If it's a good firewall, you can't. Among other options, a firewall can:
- reply with one of several different ICMP messages, indicating the destination is not accessible, or
- silently discard the request, resulting in a timeout.
A reasonable option is to explain why the app was unable to access the website, and provide some helpful suggestions:
No response from www.site.com:
* Your computer may not be connected to the Internet.
* The site may be down.
* The site may be blocked by a firewall.
The network indicated that www.site.com is not accessible:
* Helpful messages go here.
The important point is to differentiate, perhaps better than I did above, between the types of failure, and the reasons behind them. For example, the steps for troubleshooting "no response" will be different from those for troubleshooting "the device told me it's not listening on that port."