From 05a4862f837dffe5571963f40af0fc48e90b1abb Mon Sep 17 00:00:00 2001 From: Davide Date: Sun, 8 Sep 2024 20:24:47 +0200 Subject: [PATCH] Checking also for ValueError --- microrabbit/app/rabbit_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microrabbit/app/rabbit_client.py b/microrabbit/app/rabbit_client.py index f65d98f..abd4f21 100644 --- a/microrabbit/app/rabbit_client.py +++ b/microrabbit/app/rabbit_client.py @@ -62,7 +62,7 @@ async def _handler(self, exchange: Exchange, function: Callable[..., Awaitable], body = message.body.decode() try: data = ast.literal_eval(body) - except SyntaxError: + except (SyntaxError, ValueError): data = body _logger.debug(f"Received message {data} from {message.routing_key}")