This commit is contained in:
yumoqing 2020-06-03 16:27:25 +08:00
parent f92fd0b2f4
commit a10afe270f

View File

@ -7,15 +7,16 @@ class InsufficientPrivilege(Exception):
pass pass
class HTTPError(Exception): class HTTPError(Exception):
def __init__(self,resp_code): def __init__(self,resp_code,url=None):
self.resp_code = resp_code self.resp_code = resp_code
self.url = url
Exception.__init__(self) Exception.__init__(self)
def __expr__(self): def __expr__(self):
return f'Exception:return code={self.resp_code}' return f'{self.url}:{self.resp_code}'
def __str__(self): def __str__(self):
return f'Exception:return code={self.resp_code}' return f'{self.url}:{self.resp_code}'
hostsessions = {} hostsessions = {}