try/except validate, refresh, login
This commit is contained in:
parent
2030bfc97b
commit
3f647bb561
1 changed files with 3 additions and 3 deletions
|
@ -73,10 +73,10 @@ class MinecraftClient:
|
||||||
try:
|
try:
|
||||||
await self.authenticator.validate() # will raise an exc if token is invalid
|
await self.authenticator.validate() # will raise an exc if token is invalid
|
||||||
except AuthException:
|
except AuthException:
|
||||||
if self.authenticator.refreshable:
|
try:
|
||||||
await self._authenticator.refresh()
|
await self.authenticator.refresh()
|
||||||
self.logger.warning("Refreshed Token")
|
self.logger.warning("Refreshed Token")
|
||||||
else:
|
except AuthException:
|
||||||
await self.authenticator.login()
|
await self.authenticator.login()
|
||||||
self.logger.info("Logged in")
|
self.logger.info("Logged in")
|
||||||
self._authenticated = True
|
self._authenticated = True
|
||||||
|
|
Loading…
Reference in a new issue