Skip to content

Commit

Permalink
catch specific error first
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Jun 5, 2024
1 parent 54371ab commit a6e83ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/message_queue_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ async def _connect(self) -> None:
),
loop=asyncio.get_running_loop(),
)
except ConnectionError as e:
self._logger.warning("Unable to connect to RabbitMQ. Is it running?")
raise ConnectionAttemptFailed from e
except ProbableAuthenticationError as e:
self._logger.warning(
"Unable to connect to RabbitMQ. Incorrect credentials?"
)
raise ConnectionAttemptFailed from e
except ConnectionError as e:
self._logger.warning("Unable to connect to RabbitMQ. Is it running?")
raise ConnectionAttemptFailed from e
except Exception as e:
self._logger.warning(
"Unable to connect to RabbitMQ due to unhandled excpetion %s. Incorrect vhost?",
Expand Down

0 comments on commit a6e83ae

Please sign in to comment.