added socket timeout exception handling regarding that timeout message from Fahad Al Shunaiber

This commit is contained in:
Miroslav Stampar 2010-03-26 11:51:23 +00:00
parent be81c20298
commit 5a6a01f24c

View File

@ -24,6 +24,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import cookielib import cookielib
import re import re
import socket
import urllib2 import urllib2
from lib.core.convert import urlencode from lib.core.convert import urlencode
@ -129,7 +130,7 @@ class Google:
logger.log(8, responseMsg) logger.log(8, responseMsg)
except urllib2.HTTPError, e: except urllib2.HTTPError, e:
page = e.read() page = e.read()
except urllib2.URLError, e: except (urllib2.URLError, socket.error, socket.timeout), e:
errMsg = "unable to connect to Google" errMsg = "unable to connect to Google"
raise sqlmapConnectionException, errMsg raise sqlmapConnectionException, errMsg