mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-03 08:51:10 -05:00
Hah, changed WebError to Error everywhere but the source :)
This commit is contained in:
parent
3582fa47af
commit
5ca79f0f49
@ -98,18 +98,18 @@ def getUrlFd(url, headers=None):
|
|||||||
fd = urllib2.urlopen(request)
|
fd = urllib2.urlopen(request)
|
||||||
return fd
|
return fd
|
||||||
except socket.timeout, e:
|
except socket.timeout, e:
|
||||||
raise WebError, TIMED_OUT
|
raise Error, TIMED_OUT
|
||||||
except (socket.error, socket.sslerror), e:
|
except (socket.error, socket.sslerror), e:
|
||||||
raise WebError, strError(e)
|
raise Error, strError(e)
|
||||||
except httplib.InvalidURL, e:
|
except httplib.InvalidURL, e:
|
||||||
raise WebError, 'Invalid URL: %s' % e
|
raise Error, 'Invalid URL: %s' % e
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
raise WebError, strError(e)
|
raise Error, strError(e)
|
||||||
except urllib2.URLError, e:
|
except urllib2.URLError, e:
|
||||||
raise WebError, strError(e.reason)
|
raise Error, strError(e.reason)
|
||||||
# Raised when urllib doesn't recognize the url type
|
# Raised when urllib doesn't recognize the url type
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
raise WebError, strError(e)
|
raise Error, strError(e)
|
||||||
|
|
||||||
def getUrl(url, size=None, headers=None):
|
def getUrl(url, size=None, headers=None):
|
||||||
"""Gets a page. Returns a string that is the page gotten."""
|
"""Gets a page. Returns a string that is the page gotten."""
|
||||||
@ -120,7 +120,7 @@ def getUrl(url, size=None, headers=None):
|
|||||||
else:
|
else:
|
||||||
text = fd.read(size)
|
text = fd.read(size)
|
||||||
except socket.timeout, e:
|
except socket.timeout, e:
|
||||||
raise WebError, TIMED_OUT
|
raise Error, TIMED_OUT
|
||||||
fd.close()
|
fd.close()
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user