I'm trying to catch an exception while doing:
myStreamRequest = GetRequestStream()
The problem is that I get the same error when my pc doesn't have a correct network connection (it is unplugged) and when the requested URL is not correct. The exception is WebException
and the status: NameResolutionFailure
, and I need to make a difference between those two errors. I've been trying to catch a possible innerException
, but it is not thrown in this case.
What should I do?