fix: res is not set, return code 0

This commit is contained in:
əlemi 2022-06-22 13:04:08 +02:00
parent c359e2221a
commit 14da27e52e
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -77,7 +77,7 @@ class AuthInterface:
raise AuthException(endpoint, res.status, data, kwargs)
return data
except TimeoutError:
raise AuthException(endpoint, res.status, {"error": "request timed out"}, kwargs)
raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs)
@classmethod
async def _get(cls, endpoint:str, **kwargs) -> Dict[str, Any]:
@ -93,7 +93,7 @@ class AuthInterface:
raise AuthException(endpoint, res.status, data, kwargs)
return data
except TimeoutError:
raise AuthException(endpoint, res.status, {"error": "request timed out"}, kwargs)
raise AuthException(endpoint, 0, {"error": "request timed out"}, kwargs)
class OfflineAuthenticator(AuthInterface):
def __init__(self, name:str, id:str=''):