Skip to content

Commit b201e30

Browse files
author
Bilal Al
committed
polish
1 parent 30be6fa commit b201e30

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

splitio/push/manager.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,15 @@ async def _get_auth_token(self):
397397
"""Get new auth token"""
398398
try:
399399
token = await self._auth_api.authenticate()
400-
except APIException:
400+
except APIException as e:
401401
_LOGGER.error('error performing sse auth request.')
402402
_LOGGER.debug('stack trace: ', exc_info=True)
403403
await self._feedback_loop.put(Status.PUSH_RETRYABLE_ERROR)
404-
raise
404+
raise AuthException(e)
405405

406406
if token is not None and not token.push_enabled:
407407
await self._feedback_loop.put(Status.PUSH_NONRETRYABLE_ERROR)
408-
raise Exception("Push is not enabled")
408+
raise AuthException("Push is not enabled")
409409

410410
await self._telemetry_runtime_producer.record_token_refreshes()
411411
await self._telemetry_runtime_producer.record_streaming_event((StreamingEventTypes.TOKEN_REFRESH, 1000 * token.exp, get_current_epoch_time_ms()))
@@ -417,11 +417,7 @@ async def _trigger_connection_flow(self):
417417
self._status_tracker.reset()
418418

419419
try:
420-
try:
421-
token = await self._get_auth_token()
422-
except Exception as e:
423-
raise AuthException(e)
424-
420+
token = await self._get_auth_token()
425421
events_source = self._sse_client.start(token)
426422
self._running = True
427423

0 commit comments

Comments
 (0)