I\'m developing an app using a Python library urllib
and it is sometimes rising exceptions due to not being able to access an URL.
However, the exception is
urllib can raise a lot of exceptions.
You need to put a try block around the call into urllib and figure how to handle the exceptions for example:
try:
resp = urllib.request.urlopen(req)
except URLError as e:
# analyse e to figure out the detail
...
Certainly under python2's urllib lots of other exceptions are thrown. I'm not sure about python3's urllib.