Python urllib2 URLError HTTP status code.

Viewed 61146

I want to grab the HTTP status code once it raises a URLError exception:

I tried this but didn't help:

except URLError, e:
    logger.warning( 'It seems like the server is down. Code:' + str(e.code) )
2 Answers
Related