properly subclass Exception in HTTPError
This commit is contained in:
parent
71834aeab1
commit
52c6ba8880
|
@ -1,15 +1,15 @@
|
||||||
import string, urlparse, binascii
|
import string, urlparse, binascii
|
||||||
import odict, utils
|
import odict, utils
|
||||||
|
|
||||||
|
|
||||||
class HttpError(Exception):
|
class HttpError(Exception):
|
||||||
def __init__(self, code, msg):
|
def __init__(self, code, message):
|
||||||
self.code, self.msg = code, msg
|
super(HttpError, self).__init__(message)
|
||||||
|
self.code = code
|
||||||
def __str__(self):
|
|
||||||
return "HttpError(%s, %s)"%(self.code, self.msg)
|
|
||||||
|
|
||||||
|
|
||||||
class HttpErrorConnClosed(HttpError): pass
|
class HttpErrorConnClosed(HttpError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _is_valid_port(port):
|
def _is_valid_port(port):
|
||||||
|
|
Loading…
Reference in New Issue